feat: pkg vanikam as container
This commit is contained in:
parent
1fba174617
commit
cc52131f8a
3 changed files with 56 additions and 0 deletions
11
.dockerignore
Normal file
11
.dockerignore
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
/target
|
||||||
|
.env
|
||||||
|
# Devenv
|
||||||
|
.devenv*
|
||||||
|
devenv.local.nix
|
||||||
|
|
||||||
|
# direnv
|
||||||
|
.direnv
|
||||||
|
|
||||||
|
# pre-commit
|
||||||
|
.pre-commit-config.yaml
|
30
Dockerfile
Normal file
30
Dockerfile
Normal file
|
@ -0,0 +1,30 @@
|
||||||
|
#FROM node:16.9.1 as frontend
|
||||||
|
#COPY package.json package-lock.json /src/
|
||||||
|
#WORKDIR /src
|
||||||
|
#RUN npm install
|
||||||
|
#COPY . .
|
||||||
|
#RUN npm run sass
|
||||||
|
#
|
||||||
|
FROM rust:slim as rust
|
||||||
|
WORKDIR /src
|
||||||
|
RUN apt-get update && apt-get install -y git pkg-config libssl-dev make
|
||||||
|
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 || true
|
||||||
|
#COPY --from=frontend /src/static/ /src/static/
|
||||||
|
COPY . /src
|
||||||
|
#RUN cd utils/cache-bust && cargo run
|
||||||
|
RUN cargo build --release
|
||||||
|
|
||||||
|
FROM debian:latest
|
||||||
|
RUN apt-get update && apt-get install -y libssl-dev ca-certificates
|
||||||
|
RUN useradd -ms /bin/bash forgeflux
|
||||||
|
#RUN mkdir -p /var/www/forgeflux && chown forgeflux /var/www/forgeflux
|
||||||
|
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/forgeflux /usr/local/bin/
|
||||||
|
|
||||||
|
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
|
15
scripts/entrypoint.sh
Normal file
15
scripts/entrypoint.sh
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
VANIKAM_USER=vanikam
|
||||||
|
|
||||||
|
export HOME=/home/$VANIKAM_USER
|
||||||
|
#adduser --disabled-password --shell /bin/bash --home $HOME --uid $USER_ID user
|
||||||
|
#--uid
|
||||||
|
|
||||||
|
if id "$1" &>/dev/null; then
|
||||||
|
echo "User $VANIKAM_USER exists"
|
||||||
|
else
|
||||||
|
useradd -b /home -m -s /bin/bash $VANIKAM_USER
|
||||||
|
fi
|
||||||
|
|
||||||
|
su $VANIKAM_USER -c 'vanikam'
|
Loading…
Reference in a new issue