diff --git a/Dockerfile b/Dockerfile index c2860c6..59e48db 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,13 +7,16 @@ ################################################################################ # Create a stage for building the application. -ARG RUST_VERSION=1.89.0 -FROM rust:${RUST_VERSION}-slim-bullseye AS build +ARG RUST_VERSION=1 +FROM rust:${RUST_VERSION}-slim AS build ARG TARGET=release ARG APP_NAME=urls-txt WORKDIR /app -RUN rm /var/lib/dpkg/info/libc-bin.* && apt-get clean && apt-get update && apt install libc-bin +RUN rm /var/lib/dpkg/info/libc-bin.* \ + && apt-get clean \ + && apt-get update \ + && apt-get install -y libc-bin # Build the application. # Leverage a cache mount to /usr/local/cargo/registry/ @@ -46,9 +49,13 @@ EOF # most recent version of that tag when you build your Dockerfile. If # reproducability is important, consider using a digest # (e.g., debian@sha256:ac707220fbd7b67fc19b112cee8170b41a9e97f703f588b2cdbbcdcecdd8af57). -FROM debian:bullseye-slim AS final -RUN rm /var/lib/dpkg/info/libc-bin.* && apt-get clean && apt-get update && apt install libc-bin -ENV URLS_TXT_BIND_ADDRESS=0.0.0.0:3000 +FROM debian:trixie-slim AS final + +RUN rm /var/lib/dpkg/info/libc-bin.* \ + && apt-get clean \ + && apt-get update \ + && apt-get upgrade -y \ + && apt-get install -y libc-bin adduser # Create a non-privileged user that the app will run under. # See https://docs.docker.com/develop/develop-images/dockerfile_best-practices/ #user @@ -63,11 +70,9 @@ RUN adduser \ appuser USER appuser -# Copy the executable from the "build" stage. COPY --from=build /bin/server /bin/ -# Expose the port that the application listens on. -EXPOSE 8000 +EXPOSE 3000 -# What the container should run when it is started. +ENV URLS_TXT_BIND_ADDRESS=0.0.0.0:3000 CMD ["/bin/server", "/urls.txt"]