diff --git a/Dockerfile b/Dockerfile index 300c02a..a2a5888 100644 --- a/Dockerfile +++ b/Dockerfile @@ -36,33 +36,29 @@ RUN mix assets.deploy # Build release RUN mix release -# App stage -FROM alpine:3.19 AS app +# App stage - use same elixir base to ensure OpenSSL compatibility +FROM elixir:1.17-alpine AS app -# Install runtime dependencies including OpenSSL 3.x +# Install runtime dependencies RUN apk add --no-cache \ libstdc++ \ openssl \ - openssl-dev \ - ncurses-libs \ - libgcc \ - libcrypto3 \ - libssl3 + ncurses-libs WORKDIR /app # Copy the release from build stage COPY --from=build /app/_build/prod/rel/my_first_elixir_vibe_code ./ -# Copy entrypoint script -COPY entrypoint.sh /entrypoint.sh -RUN chmod +x /entrypoint.sh - # Create a non-root user RUN addgroup -g 1000 phoenix && \ adduser -D -u 1000 -G phoenix phoenix && \ chown -R phoenix:phoenix /app +# Copy entrypoint script and set permissions +COPY --chown=phoenix:phoenix entrypoint.sh /entrypoint.sh +RUN chmod +x /entrypoint.sh + USER phoenix EXPOSE 4000