mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
9086c8a3bf
- All InvenTree data now in a single subdir - Copy default config file (if it does not exist) - Config file is accessible from outside world - Update start_server and start_worker scripts
73 lines
2.3 KiB
YAML
73 lines
2.3 KiB
YAML
version: "3.8"
|
|
|
|
# Docker compose recipe for InvenTree
|
|
# - Runs PostgreSQL as the database backend
|
|
# - Serves web data using Gunicorn
|
|
# - Runs the background worker process
|
|
# - Runs nginx as a reverse proxy
|
|
|
|
services:
|
|
# 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
|
|
db:
|
|
image: postgres
|
|
container_name: inventree_db
|
|
ports:
|
|
- 5432/tcp
|
|
environment:
|
|
- PGDATA=/var/lib/postgresql/data/pgdb
|
|
- POSTGRES_USER=pguser
|
|
- POSTGRES_PASSWORD=pgpassword
|
|
volumes:
|
|
# Map external directory to store database data
|
|
# Replace /path/to/dir with the required external path
|
|
- /mnt/c/abcdatabase:/var/lib/postgresql/data/
|
|
restart: unless-stopped
|
|
|
|
server:
|
|
build:
|
|
context: .
|
|
args:
|
|
repository: "https://github.com/SchrodingersGat/InvenTree.git"
|
|
branch: "django-q"
|
|
image: inventree/inventree:latest
|
|
container_name: inventree_server
|
|
ports:
|
|
- "8080:8080"
|
|
depends_on:
|
|
- db
|
|
volumes:
|
|
# Map external directory to store InvenTree data
|
|
# Replace /path/to/dir with the required external path
|
|
- /mnt/c/abcde:/home/inventree/data
|
|
environment:
|
|
- INVENTREE_DB_ENGINE=postgresql
|
|
- INVENTREE_DB_NAME=inventree
|
|
- INVENTREE_DB_USER=pguser
|
|
- INVENTREE_DB_PASSWORD=pgpassword
|
|
- INVENTREE_DB_PORT=5432
|
|
- INVENTREE_DB_HOST=db
|
|
restart: unless-stopped
|
|
|
|
worker:
|
|
build:
|
|
context: .
|
|
args:
|
|
repository: "https://github.com/SchrodingersGat/InvenTree.git"
|
|
branch: "django-q"
|
|
entrypoint: ./start_worker.sh
|
|
image: inventree/worker:latest
|
|
container_name: inventree_worker
|
|
depends_on:
|
|
- db
|
|
- server
|
|
environment:
|
|
- INVENTREE_DB_ENGINE=postgresql
|
|
- INVENTREE_DB_NAME=inventree
|
|
- INVENTREE_DB_USER=pguser
|
|
- INVENTREE_DB_PASSWORD=pgpassword
|
|
- INVENTREE_DB_PORT=5432
|
|
- INVENTREE_DB_HOST=db
|
|
restart: unless-stopped
|