Skip to content
This repository was archived by the owner on Nov 10, 2025. It is now read-only.

Commit 8ffdf01

Browse files
committed
Set the owner of the /app/tmp and /tmp volumes in the Dockerfile
AWS ECS documentation [1] shows how volume ownership should be set [1] https://docs.aws.amazon.com/AmazonECS/latest/developerguide/bind-mounts.html
1 parent 6d32172 commit 8ffdf01

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

Dockerfile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,6 @@ COPY --chown=ruby:ruby . .
3737

3838
FROM base AS app
3939

40-
VOLUME "/tmp/"
41-
VOLUME "/app/tmp/"
42-
4340
ENV RAILS_ENV="${RAILS_ENV:-production}" \
4441
PATH="${PATH}:/home/ruby/.local/bin" \
4542
USER="ruby"
@@ -61,6 +58,10 @@ RUN chmod 0755 bin/*
6158
COPY --chown=ruby:ruby --from=build /usr/local/bundle /usr/local/bundle
6259
COPY --chown=ruby:ruby --from=build /app /app
6360

61+
RUN mkdir -p "/tmp" "/app/tmp/" && chown ruby:ruby "/tmp" && chown ruby:ruby "/app/tmp/"
62+
VOLUME "/tmp/"
63+
VOLUME "/app/tmp/"
64+
6465
EXPOSE 9292
6566

6667
CMD ["/bin/sh", "-o", "xtrace", "-c", "rails s -b 0.0.0.0 -p 9292"]

0 commit comments

Comments
 (0)