From 076c84885aac929d077cb15da7afda4b86db364d Mon Sep 17 00:00:00 2001 From: Frank Elsinga Date: Wed, 30 Aug 2023 01:19:02 +0200 Subject: [PATCH] storage not being persistent in docker --- docker-compose.yaml | 4 ++++ server/Dockerfile | 8 ++++++++ 2 files changed, 12 insertions(+) diff --git a/docker-compose.yaml b/docker-compose.yaml index 72b4bb46..da3ab093 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -14,7 +14,9 @@ services: - APNS_TEAM_ID=${APNS_TEAM_ID} - APNS_P8_FILE_PATH=${APNS_P8_FILE_PATH} volumes: + - backend-storage:/Storage - ./apns_auth_key.p8:${APNS_P8_FILE_PATH} + user: 1000:3000 depends_on: db: condition: service_healthy @@ -38,4 +40,6 @@ services: volumes: campus-db-data: + driver: local + backend-storage: driver: local \ No newline at end of file diff --git a/server/Dockerfile b/server/Dockerfile index 204bf122..2e303d97 100644 --- a/server/Dockerfile +++ b/server/Dockerfile @@ -25,8 +25,16 @@ COPY --from=builder /backend /backend COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ COPY --from=builder /etc/passwd /etc/passwd +# make sure that /Storage is mounted with the correct access permissions even in docker-compose +RUN mkdir /Storage +RUN chown appuser /Storage +VOLUME /Storage + # Use an unprivileged user USER appuser +# documentation for docker-compose +EXPOSE 50051 + # Run the main binary CMD ["/backend"]