package docker container

service-provider
Aravinth Manivannan 1 year ago
parent 4d5f6ebd6f
commit eacb1b108a
Signed by: realaravinth
GPG Key ID: AD9F0F08E855ED88
  1. 8
      .dockerignore
  2. 20
      Dockerfile
  3. 1
      README.md
  4. 12
      scripts/entrypoint.sh

@ -0,0 +1,8 @@
/target
tarpaulin-report.html
.env
cobertura.xml
coverage/
node_modules/
/static/cache/bundle/*
scripts/creds.py

@ -0,0 +1,20 @@
FROM rust:1.56-slim-bullseye as rust
WORKDIR /src
RUN apt-get update && apt-get install -y git pkg-config libssl-dev
RUN mkdir src && echo "fn main() {}" > src/main.rs
COPY Cargo.toml .
RUN sed -i '/.*build.rs.*/d' Cargo.toml
COPY Cargo.lock .
RUN cargo build --release
COPY . /src
RUN cargo build --release
FROM debian:bullseye-slim
#RUN useradd -ms /bin/bash -u 1000 pages
#RUN mkdir -p /var/www/pages && chown pages /var/www/pages
RUN apt-get update && apt-get install -y ca-certificates
COPY scripts/entrypoint.sh /usr/local/bin/entrypoint.sh
RUN chmod +x /usr/local/bin/entrypoint.sh
COPY --from=rust /src/target/release/pages /usr/local/bin/
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]

@ -1,5 +1,4 @@
<div align="center">
<img width="120px" src="./static/cache/img/logo.svg" alt="pages logo">
<h1> Pages </h1>
<p>

@ -0,0 +1,12 @@
#!/bin/bash
USER_ID=${LOCAL_USER_ID}
echo $USER_ID
echo "Starting with UID : $USER_ID"
export HOME=/home/user
#adduser --disabled-password --shell /bin/bash --home $HOME --uid $USER_ID user
#--uid
sudo useradd --uid $USER_ID -b /home -m -s /bin/bash user
su - user
pages
Loading…
Cancel
Save