diff --git a/Dockerfile b/Dockerfile index f165e2f..7dd1eac 100644 --- a/Dockerfile +++ b/Dockerfile @@ -42,7 +42,13 @@ RUN bundle config set force_ruby_platform true RUN bundle config set system 'true' RUN bundle install -# COPY --chown=bfs:bfs . . +# ================================= +# Target: production +# ================================= +FROM base AS production + +# Copy the built codebase from the dev stage +COPY --from=development --chown=bfs /usr/local/bundle /usr/local/bundle # ================================= # Target: production @@ -50,9 +56,10 @@ RUN bundle install FROM base AS production # Copy the built codebase from the dev stage -# COPY --from=development --chown=bfs /opt/app /opt/app COPY --from=development --chown=bfs /usr/local/bundle /usr/local/bundle +USER bfs + WORKDIR /opt/app RUN bundle config set frozen 'true' RUN bundle install --local diff --git a/docker-compose.yml b/docker-compose.yml index 13f8c03..eacba8c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -13,8 +13,8 @@ services: - ./:/opt/app:rw - ./secrets:/run/secrets:ro secrets: - - source: SSH_KEY - target: /opt/app/.ssh/id_rsa + - source: SSH_KEY + target: /home/bfs/.ssh/id_rsa uid: "40061" gid: "40061" mode: 0400