Refactoring docker-compose.postgresql.yml

- Do not require duplication of username / password values
- Specify different env file
- Move to a new child directory which simplifies setup
This commit is contained in:
Oliver Walters 2022-04-20 21:44:22 +10:00
parent f0a01587ac
commit e4e735a71b
3 changed files with 4 additions and 10 deletions

View File

@ -1,4 +1,4 @@
# InvenTree environment variables for a production setup
# InvenTree environment variables for a postgresql production setup
# Note: If your production setup varies from the example, you may want to change these values

View File

@ -40,9 +40,9 @@ services:
environment:
- PGDATA=/var/lib/postgresql/data/pgdb
# The pguser and pgpassword values must be the same in the other containers
# Ensure that these are correctly configured in your prod-config.env file
- POSTGRES_USER=pguser
- POSTGRES_PASSWORD=pgpassword
# Ensure that these are correctly configured in your .env file
- POSTGRES_USER=${INVENTREE_DB_USER}
- POSTGRES_PASSWORD=${INVENTREE_DB_PASSWORD}
volumes:
# Map 'data' volume such that postgres database is stored externally
- data:/var/lib/postgresql/data/
@ -61,9 +61,6 @@ services:
volumes:
# Data volume must map to /home/inventree/data
- data:/home/inventree/data
env_file:
# Environment variables required for the production server are configured in prod-config.env
- prod-config.env
restart: unless-stopped
# Background worker process handles long-running or periodic tasks
@ -78,9 +75,6 @@ services:
volumes:
# Data volume must map to /home/inventree/data
- data:/home/inventree/data
env_file:
# Environment variables required for the production server are configured in prod-config.env
- prod-config.env
restart: unless-stopped
# nginx acts as a reverse proxy