Fix permission error in Dockerfile

- Create deployed_at.txt before switching to elixir user
- Set proper ownership on the file
- This fixes the 'Permission denied' error during build

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Graham McIntire 2025-07-26 16:32:21 -05:00
parent 160c4fdc0e
commit ddd405940e
No known key found for this signature in database

View file

@ -57,9 +57,12 @@ RUN apt-get update -y && \
ENV LANG=en_US.UTF-8 LANGUAGE=en_US:en LC_ALL=en_US.UTF-8
WORKDIR /app
# Create deployment timestamp before switching users
RUN date -u +"%Y-%m-%dT%H:%M:%SZ" > /app/deployed_at.txt && \
chown elixir:root /app/deployed_at.txt
COPY --from=builder --chown=elixir:root /app/_build/prod/rel/aprsme ./
USER elixir
RUN date -u +"%Y-%m-%dT%H:%M:%SZ" > /app/deployed_at.txt
CMD ["/app/bin/server"]