51 lines
1.3 KiB
Docker
51 lines
1.3 KiB
Docker
# syntax=docker/dockerfile:1
|
|
FROM rust:1.99-trixie AS build
|
|
|
|
WORKDIR /build
|
|
COPY . .
|
|
|
|
RUN if [ ! -f Cargo.lock ]; then cargo generate-lockfile; fi \
|
|
&& cargo build --locked --release
|
|
|
|
|
|
FROM debian:trixie-slim AS runtime-trixie
|
|
|
|
RUN apt-get update \
|
|
&& apt-get install -y --no-install-recommends \
|
|
ca-certificates \
|
|
python3 \
|
|
certbot \
|
|
openssl \
|
|
gosu \
|
|
&& rm -rf /var/lib/apt/lists/* \
|
|
&& groupadd --system --gid 10001 rustproxy \
|
|
&& useradd --system \
|
|
--uid 10001 \
|
|
--gid rustproxy \
|
|
--home /var/lib/rustproxy \
|
|
--shell /usr/sbin/nologin \
|
|
rustproxy \
|
|
&& install -d -o rustproxy -g rustproxy -m 0700 /var/lib/rustproxy \
|
|
&& install -d -o rustproxy -g rustproxy -m 0750 /var/log/rustproxy
|
|
|
|
COPY --from=build /build/target/release/rust-proxy /usr/local/bin/rust-proxy
|
|
COPY integrations/routeros-oci-build/docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh
|
|
|
|
RUN chmod 0755 \
|
|
/usr/local/bin/rust-proxy \
|
|
/usr/local/bin/docker-entrypoint.sh
|
|
|
|
ENV RUST_LOG=rust_proxy=info,warn \
|
|
RUST_PROXY_DATA_DIR=/var/lib/rustproxy \
|
|
RUST_PROXY_ADMIN_LISTEN=0.0.0.0:9090 \
|
|
RUST_PROXY_PROXY_LISTEN=0.0.0.0:8080 \
|
|
RUST_PROXY_TLS_LISTEN=0.0.0.0:8443
|
|
|
|
VOLUME ["/var/lib/rustproxy"]
|
|
|
|
EXPOSE 8080/tcp
|
|
EXPOSE 8443/tcp
|
|
EXPOSE 9090/tcp
|
|
|
|
ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"]
|
|
CMD ["serve", "--allow-remote-admin"] |