From e4e735a71bd0fcd2b4550be809fd2fc6d56f68be Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Wed, 20 Apr 2022 21:44:22 +1000 Subject: [PATCH] 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 --- docker/{prod-config.env => production/.env} | 2 +- .../docker-compose.yml} | 12 +++--------- docker/{ => production}/nginx.conf | 0 3 files changed, 4 insertions(+), 10 deletions(-) rename docker/{prod-config.env => production/.env} (88%) rename docker/{docker-compose.postgresql.yml => production/docker-compose.yml} (90%) rename docker/{ => production}/nginx.conf (100%) diff --git a/docker/prod-config.env b/docker/production/.env similarity index 88% rename from docker/prod-config.env rename to docker/production/.env index a69fa10d2a..88eae34ebe 100644 --- a/docker/prod-config.env +++ b/docker/production/.env @@ -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 diff --git a/docker/docker-compose.postgresql.yml b/docker/production/docker-compose.yml similarity index 90% rename from docker/docker-compose.postgresql.yml rename to docker/production/docker-compose.yml index 2f38182418..abb24f5f9e 100644 --- a/docker/docker-compose.postgresql.yml +++ b/docker/production/docker-compose.yml @@ -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 diff --git a/docker/nginx.conf b/docker/production/nginx.conf similarity index 100% rename from docker/nginx.conf rename to docker/production/nginx.conf