From 90cfeec59bf25eda1d73f577ead27f9bb9a7e80a Mon Sep 17 00:00:00 2001 From: Kevin Sivic Date: Fri, 28 Nov 2025 22:27:17 -0500 Subject: [PATCH] Fix entrypoint.sh permissions in Docker container MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Reorder Dockerfile to create phoenix user before copying entrypoint.sh - Use --chown flag to set proper ownership of entrypoint.sh - Resolves "Permission denied" error when starting container 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- Dockerfile | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) 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