diff --git a/README.md b/README.md index ef408b4..1f71960 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ services: - API_PROXY_TARGET=http://localhost:8911 - MAX_HTTP_CONNECTIONS_PER_MINUTE=60 - SESSION_SECRET=super_secret_session_key_change_me_in_production_please - - DATABASE_URL=postgresql://redwood:redwood@db:5432/portfolio + - DATABASE_URL=postgresql://redwood:changeme@db:5432/portfolio - FIRST_NAME=first name # Your first name - LAST_NAME=lastname # Your last name - GMAIL=example@gmail.com # The Gmail address associated with the app password created earlier @@ -34,10 +34,12 @@ services: - ADDRESS_PROD=https://portfolio.example.com # https://DOMAIN - API_ADDRESS_PROD=https://api.portfolio.example.com # https://API_DOMAIN ports: - - '8910:8910' # Web - - '8911:8911' # API + - 8910:8910 # Web + - 8911:8911 # API depends_on: - db + volumes: + - files:/home/node/app/api/files_prod command: > /bin/sh -c " yarn rw build && @@ -50,16 +52,22 @@ services: container_name: portfolio-db image: postgres:16-bookworm environment: - POSTGRES_USER: redwood - POSTGRES_PASSWORD: redwood - POSTGRES_DB: portfolio + - POSTGRES_USER=redwood + - POSTGRES_PASSWORD=changeme + - POSTGRES_DB=portfolio ports: - - '5432:5432' + - 5432:5432 volumes: - postgres:/var/lib/postgresql/data volumes: postgres: + files: # For persistent file storage across upgrades +``` +## Fix Files Ownership +The `files` volume in Docker is owned by `root`, since the portfolio container runs under the `node` user, file uploads will fail. Run this command to give ownership to the `node` user: +``` +sudo docker exec -u root portfolio chown -R node:node /home/node/app/api/files_prod ``` ## Logging In - Once the container is up and running, head to `/login` (`https://portfolio.example.com/login`), default credentials are below diff --git a/docker-compose.yml b/docker-compose.yml index c43ccdc..1fba2fc 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -9,7 +9,7 @@ services: - API_PROXY_TARGET=http://localhost:8911 - MAX_HTTP_CONNECTIONS_PER_MINUTE=60 - SESSION_SECRET=super_secret_session_key_change_me_in_production_please - - DATABASE_URL=postgresql://redwood:redwood@db:5432/portfolio + - DATABASE_URL=postgresql://redwood:changeme@db:5432/portfolio - FIRST_NAME=first name # Your first name - LAST_NAME=lastname # Your last name - GMAIL=example@gmail.com # The Gmail address associated with the app password created earlier @@ -20,10 +20,12 @@ services: - ADDRESS_PROD=https://portfolio.example.com # https://DOMAIN - API_ADDRESS_PROD=https://api.portfolio.example.com # https://API_DOMAIN ports: - - '8910:8910' # Web - - '8911:8911' # API + - 8910:8910 # Web + - 8911:8911 # API depends_on: - db + volumes: + - files:/home/node/app/api/files_prod command: > /bin/sh -c " yarn rw build && @@ -36,13 +38,14 @@ services: container_name: portfolio-db image: postgres:16-bookworm environment: - POSTGRES_USER: redwood - POSTGRES_PASSWORD: redwood - POSTGRES_DB: portfolio + - POSTGRES_USER=redwood + - POSTGRES_PASSWORD=changeme + - POSTGRES_DB=portfolio ports: - - '5432:5432' + - 5432:5432 volumes: - postgres:/var/lib/postgresql/data volumes: postgres: + files: # For persistent file storage across upgrades