Skip to content

Commit

Permalink
build: Use debian for runtime container
Browse files Browse the repository at this point in the history
  • Loading branch information
arkadyan committed Jul 24, 2024
1 parent 3ba68a8 commit 2d6dad7
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,22 @@ COPY --from=assets-builder /root/priv/static ./priv/static

RUN mix do compile --force, phx.digest, release

# Finally, use an Alpine container for the runtime environment
FROM alpine:3.20.2

RUN apk add --update libssl1.1 ncurses-libs bash curl dumb-init \
&& apk upgrade \
&& rm -rf /var/cache/apk




# --- Set up runtime container ---
FROM debian:bullseye-slim

ENV LANG=C.UTF-8 MIX_ENV=prod REPLACE_OS_VARS=true

RUN apt-get update --allow-releaseinfo-change \
&& apt-get install --no-install-recommends --yes dumb-init ca-certificates \
&& rm -rf /var/lib/apt/lists/*

# Create non-root user
RUN addgroup -S document_viewer && adduser -S -G document_viewer document_viewer
RUN addgroup --system document_viewer && adduser --system --ingroup document_viewer document_viewer
USER document_viewer
WORKDIR /home/document_viewer

Expand Down

0 comments on commit 2d6dad7

Please sign in to comment.