classify-client/Dockerfile

32 строки
683 B
Docker
Исходник Обычный вид История

FROM rust:1.74-slim-bullseye as build
2018-12-21 16:16:51 +03:00
RUN apt-get update && \
apt-get install -y --no-install-recommends \
pkg-config curl libssl-dev
2018-12-11 01:54:52 +03:00
WORKDIR /app
COPY . /app
RUN cargo build --release
# -----
FROM debian:bullseye-slim as production
2018-12-21 16:16:51 +03:00
RUN apt-get update && \
apt-get install -y --no-install-recommends \
2018-12-21 22:15:32 +03:00
libssl1.1
2018-12-21 16:16:51 +03:00
2018-12-22 05:38:13 +03:00
RUN groupadd --gid 10001 app && \
useradd -g app --uid 10001 --shell /usr/sbin/nologin --no-create-home --home-dir /app app
2018-12-11 01:54:52 +03:00
WORKDIR /app
COPY --from=build /app/target/release/classify-client .
COPY --from=build /app/version.json /app/GeoLite2-Country.mmdb* ./
2018-12-21 16:16:51 +03:00
2018-12-22 05:38:13 +03:00
USER app
2018-12-23 16:18:37 +03:00
ENV PORT=8000
2018-12-11 01:54:52 +03:00
ENV HOST=0.0.0.0
EXPOSE $PORT
2018-12-21 16:16:51 +03:00
CMD ["/app/classify-client"]