diff --git a/production/docker/docker-compose.yml b/production/docker/docker-compose.yml index c695df9..104e7ad 100644 --- a/production/docker/docker-compose.yml +++ b/production/docker/docker-compose.yml @@ -49,6 +49,7 @@ services: memo-client: build: ./memo-client + image: memo-client container_name: memo-client logging: driver: json-file diff --git a/production/docker/memo-client/.env-example b/production/docker/memo-client/.env-example new file mode 100644 index 0000000..9a9f5a2 --- /dev/null +++ b/production/docker/memo-client/.env-example @@ -0,0 +1,9 @@ +# psf-memo-db REST API base URL (no trailing slash). +# Baked into the SPA when the memo-client image is built. +# Example: https://api.mydomain.com +# +# Usage: +# cp .env-example .env +# # edit REACT_APP_MEMO_DB_URL +# docker compose build memo-client +REACT_APP_MEMO_DB_URL=http://localhost:5021 diff --git a/production/docker/memo-client/Dockerfile b/production/docker/memo-client/Dockerfile index db201ea..80d31db 100644 --- a/production/docker/memo-client/Dockerfile +++ b/production/docker/memo-client/Dockerfile @@ -30,6 +30,10 @@ WORKDIR /home/safeuser/psf-memo-client # Install dependencies RUN npm install +# Create React App reads REACT_APP_* from this .env at build time. +# Edit production/docker/memo-client/.env before building. +COPY .env .env + # Build the site RUN npm run build