Changed Dockerfile

This commit is contained in:
Piyush मिश्रः 2023-02-26 07:04:30 +01:00
parent aa1fe0bf51
commit 7f42eba1ba
1 changed files with 12 additions and 16 deletions

View File

@ -1,29 +1,25 @@
FROM rust:1-alpine3.16
ENV APP=lupt
ENV PORT=8081
RUN cargo search --limit 0
RUN apk upgrade --update-cache --available && \
RUN cargo search --limit 0 && \
apk upgrade --update-cache --available && \
apk add musl-dev && \
apk add pkgconfig && \
apk add openssl-dev && \
rm -rf /var/cache/apk/*
rm -rf /var/cache/apk/* && \
mkdir -pv /app/${APP}/etc
WORKDIR /app/${APP}
RUN mkdir /app/${APP}/etc
COPY . .
RUN cargo build --release
RUN cp target/release/lupt .
RUN cargo clean
RUN cargo build --release && \
cp target/release/lupt . && \
cargo clean && \
rm -rf /usr/local/rustup/ /usr/local/cargo/ && \
apk del gcc
RUN /bin/sh -c 'export FILE=~/.cargo/registry/cache/; if [ -e $FILE ] ; then rm -rf $FILE ; fi'
RUN /bin/sh -c 'export FILE=~/.cargo/registry/src/; if [ -e $FILE ] ; then rm -rf $FILE ; fi'
RUN rm -rf /usr/local/rustup/ /usr/local/cargo/
RUN apk del gcc
EXPOSE ${PORT}/tcp
EXPOSE 8080/tcp
CMD ["${APP}", "--bind_address", "0.0.0.0", "--port", "8080", "--config-file", "/app/${APP}/etc/config.json", "--static_path", "/app/${APP}/static/"]
CMD ./${APP} --bind-address 0.0.0.0 --port ${PORT} --config-file /app/${APP}/etc/config.json --static-path /app/${APP}/static/