This commit is contained in:
Riccardo Graziosi
2024-11-08 16:40:53 +01:00
committed by GitHub
parent 5ad04adb10
commit 31999a2af6
57 changed files with 3246 additions and 53 deletions

View File

@@ -37,9 +37,12 @@ RUN yarn install --check-files
# Copy all files
COPY . ${APP_ROOT}/
# Build Swagger API documentation
RUN RSWAG_SWAGGERIZE=true RAILS_ENV=test bundle exec rake rswag:specs:swaggerize
# Compile assets if production
# SECRET_KEY_BASE=1 is a workaround (see https://github.com/rails/rails/issues/32947)
RUN if [ "$ENVIRONMENT" = "production" ]; then RAILS_ENV=development ./bin/rails assets:precompile; fi
RUN if [ "$ENVIRONMENT" = "production" ]; then SECRET_KEY_BASE=1 ./bin/rails assets:precompile; fi
###
### Dev stage ###
@@ -91,6 +94,9 @@ COPY --from=builder ${APP_ROOT}/Rakefile ${APP_ROOT}/
COPY --from=builder ${APP_ROOT}/lib/tasks/ ${APP_ROOT}/lib/tasks/
COPY --from=builder /usr/local/bundle/config /usr/local/bundle/config
# Copy Swagger API documentation
COPY --from=builder ${APP_ROOT}/swagger/ ${APP_ROOT}/swagger/
ENTRYPOINT ["./docker-entrypoint-prod.sh"]
EXPOSE 3000