Browse Source

feat: change compose file to use dedicated mysql database

master
bucde 3 years ago
parent
commit
682d55d888
1 changed files with 18 additions and 29 deletions
  1. +18
    -29
      docker-compose.yml

+ 18
- 29
docker-compose.yml View File

@ -15,26 +15,6 @@ version: "3.8"
#
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
# Uses gunicorn as the web server
inventree-server:
@ -44,15 +24,19 @@ services:
image: inventree/inventree:latest
expose:
- 8000
depends_on:
- inventree-db
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
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
inventree-worker:
@ -62,15 +46,20 @@ services:
image: inventree/inventree:latest
command: invoke worker
depends_on:
- inventree-db
- inventree-server
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
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
# static files are served directly by nginx


Loading…
Cancel
Save