Skip to content

Commit 0bff082

Browse files
committed
Make "db/" into a volume inside the Docker container
AWS ECS docs [1] say that a file that exists in a directory that is subsequently marked as a volume will be copied to the host and remounted into the container. This is necessary for us to do with the "db/" directory because the "db:migrate" Rake task writes to "db/schema.rb" [1] https://docs.aws.amazon.com/AmazonECS/latest/developerguide/bind-mounts.html
1 parent 7d943ce commit 0bff082

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,10 @@ RUN chmod 0755 bin/*
7272
COPY --chown=ruby:ruby --from=build /usr/local/bundle /usr/local/bundle
7373
COPY --chown=ruby:ruby --from=build /app /app
7474

75-
RUN mkdir -p "/app/tmp/" && chown ruby:ruby "/app/tmp/"
75+
RUN mkdir -p "/app/tmp/" && chown ruby:ruby "/app/tmp/" && chown ruby:ruby "/app/db/"
7676
VOLUME "/tmp/"
7777
VOLUME "/app/tmp/"
78+
VOLUME "/app/db/"
7879

7980
EXPOSE 3000
8081

0 commit comments

Comments
 (0)