|
@ -15,26 +15,6 @@ version: "3.8" |
|
|
# |
|
|
# |
|
|
|
|
|
|
|
|
services: |
|
|
services: |
|
|
# Database service |
|
|
|
|
|
# Use PostgreSQL as the database backend |
|
|
|
|
|
# Note: this can be changed to a different backend, |
|
|
|
|
|
# just make sure that you change the INVENTREE_DB_xxx vars below |
|
|
|
|
|
inventree-db: |
|
|
|
|
|
container_name: inventree-db |
|
|
|
|
|
image: postgres:13 |
|
|
|
|
|
ports: |
|
|
|
|
|
- 5432/tcp |
|
|
|
|
|
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 |
|
|
|
|
|
volumes: |
|
|
|
|
|
# Map 'data' volume such that postgres database is stored externally |
|
|
|
|
|
- data:/var/lib/postgresql/data/ |
|
|
|
|
|
restart: unless-stopped |
|
|
|
|
|
|
|
|
|
|
|
# InvenTree web server services |
|
|
# InvenTree web server services |
|
|
# Uses gunicorn as the web server |
|
|
# Uses gunicorn as the web server |
|
|
inventree-server: |
|
|
inventree-server: |
|
@ -44,15 +24,19 @@ services: |
|
|
image: inventree/inventree:latest |
|
|
image: inventree/inventree:latest |
|
|
expose: |
|
|
expose: |
|
|
- 8000 |
|
|
- 8000 |
|
|
depends_on: |
|
|
|
|
|
- inventree-db |
|
|
|
|
|
volumes: |
|
|
volumes: |
|
|
# Data volume must map to /home/inventree/data |
|
|
# Data volume must map to /home/inventree/data |
|
|
- data:/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 |
|
|
restart: unless-stopped |
|
|
|
|
|
environment: |
|
|
|
|
|
INVENTREE_DEBUG: False |
|
|
|
|
|
INVENTREE_LOG_LEVEL: WARNING |
|
|
|
|
|
INVENTREE_DB_ENGINE: mysql |
|
|
|
|
|
INVENTREE_DB_HOST: ${INVENTREE_DB_HOST:?err} |
|
|
|
|
|
INVENTREE_DB_PORT: ${INVENTREE_DB_PORT:?err} |
|
|
|
|
|
INVENTREE_DB_NAME: ${INVENTREE_DB_NAME:?err} |
|
|
|
|
|
INVENTREE_DB_USER: ${INVENTREE_DB_USER:?err} |
|
|
|
|
|
INVENTREE_DB_PASSWORD: ${INVENTREE_DB_PASSWORD:?err} |
|
|
|
|
|
|
|
|
# Background worker process handles long-running or periodic tasks |
|
|
# Background worker process handles long-running or periodic tasks |
|
|
inventree-worker: |
|
|
inventree-worker: |
|
@ -62,15 +46,20 @@ services: |
|
|
image: inventree/inventree:latest |
|
|
image: inventree/inventree:latest |
|
|
command: invoke worker |
|
|
command: invoke worker |
|
|
depends_on: |
|
|
depends_on: |
|
|
- inventree-db |
|
|
|
|
|
- inventree-server |
|
|
- inventree-server |
|
|
volumes: |
|
|
volumes: |
|
|
# Data volume must map to /home/inventree/data |
|
|
# Data volume must map to /home/inventree/data |
|
|
- data:/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 |
|
|
restart: unless-stopped |
|
|
|
|
|
environment: |
|
|
|
|
|
INVENTREE_DEBUG: False |
|
|
|
|
|
INVENTREE_LOG_LEVEL: WARNING |
|
|
|
|
|
INVENTREE_DB_ENGINE: mysql |
|
|
|
|
|
INVENTREE_DB_HOST: ${INVENTREE_DB_HOST:?err} |
|
|
|
|
|
INVENTREE_DB_PORT: ${INVENTREE_DB_PORT:?err} |
|
|
|
|
|
INVENTREE_DB_NAME: ${INVENTREE_DB_NAME:?err} |
|
|
|
|
|
INVENTREE_DB_USER: ${INVENTREE_DB_USER:?err} |
|
|
|
|
|
INVENTREE_DB_PASSWORD: ${INVENTREE_DB_PASSWORD:?err} |
|
|
|
|
|
|
|
|
# nginx acts as a reverse proxy |
|
|
# nginx acts as a reverse proxy |
|
|
# static files are served directly by nginx |
|
|
# static files are served directly by nginx |
|
|