Docker build

This commit is contained in:
realaravinth 2021-05-12 18:23:25 +05:30
parent 4df220edad
commit d0c5ffb486
No known key found for this signature in database
GPG key ID: AD9F0F08E855ED88

View file

@ -6,26 +6,17 @@ WORKDIR /src
COPY package.json yarn.lock ./
RUN yarn install
COPY . .
# RUN set -ex; \
# apt-get update; \
# DEBIAN_FRONTEND=noninteractive \
# apt-get install -y --no-install-recommends yarnpkg npm ca-certificates make libssl-dev; \
# rm -rf /var/lib/apt/lists/*
# RUN pwd
RUN yarn build
FROM rust:latest as rust
COPY --from=frontend /src /src
WORKDIR /src
RUN pwd
RUN ls
RUN cargo build --release
FROM debian:buster
RUN useradd -ms /bin/bash -u 1001 guard
WORKDIR /home/guard
COPY --from=rust /src/target/release/guard /home/guard/app/
COPY --from=rust /src/config /home/guard/app/
COPY --from=rust /src/target/release/guard /usr/local/bin/
COPY --from=rust /src/config/default.toml /etc/guard/config.toml
USER guard
WORKDIR /home/guard/app
CMD [ "/home/guard/app/guard" ]
CMD [ "/usr/local/bin/guard" ]