2021-12-21 05:14:04 +00:00
|
|
|
version: "3.8"
|
|
|
|
|
|
|
|
# Docker compose recipe for InvenTree development server
|
|
|
|
# - Runs sqlite database
|
|
|
|
# - Uses built-in django webserver
|
|
|
|
# - Runs the InvenTree background worker process
|
|
|
|
# - Serves media and static content directly from Django webserver
|
|
|
|
|
2023-06-03 14:04:52 +00:00
|
|
|
# IMPORTANT NOTE:
|
2021-12-21 05:14:04 +00:00
|
|
|
# The InvenTree docker image does not clone source code from git.
|
|
|
|
# Instead, you must specify *where* the source code is located,
|
|
|
|
# (on your local machine).
|
|
|
|
# The django server will auto-detect any code changes and reload the server.
|
|
|
|
|
|
|
|
services:
|
|
|
|
|
|
|
|
# InvenTree web server services
|
|
|
|
# Uses gunicorn as the web server
|
|
|
|
inventree-dev-server:
|
|
|
|
container_name: inventree-dev-server
|
|
|
|
build:
|
|
|
|
context: .
|
|
|
|
target: dev
|
2022-04-20 15:13:34 +00:00
|
|
|
# Cache the built image to be used by the inventree-dev-worker process
|
|
|
|
image: inventree-dev-image
|
2021-12-21 05:14:04 +00:00
|
|
|
ports:
|
|
|
|
# Expose web server on port 8000
|
|
|
|
- 8000:8000
|
|
|
|
volumes:
|
|
|
|
# Ensure you specify the location of the 'src' directory at the end of this file
|
|
|
|
- src:/home/inventree
|
2022-04-20 15:02:55 +00:00
|
|
|
environment:
|
|
|
|
- INVENTREE_DEBUG=True
|
|
|
|
- INVENTREE_DB_ENGINE=sqlite
|
2022-04-20 15:13:34 +00:00
|
|
|
- INVENTREE_DB_NAME=/home/inventree/db.sqlite3
|
2021-12-21 05:14:04 +00:00
|
|
|
restart: unless-stopped
|
|
|
|
|
|
|
|
# Background worker process handles long-running or periodic tasks
|
|
|
|
inventree-dev-worker:
|
|
|
|
container_name: inventree-dev-worker
|
2022-04-20 15:13:34 +00:00
|
|
|
image: inventree-dev-image
|
2021-12-21 05:14:04 +00:00
|
|
|
command: invoke worker
|
|
|
|
depends_on:
|
|
|
|
- inventree-dev-server
|
|
|
|
volumes:
|
|
|
|
# Ensure you specify the location of the 'src' directory at the end of this file
|
|
|
|
- src:/home/inventree
|
2022-04-20 15:02:55 +00:00
|
|
|
environment:
|
|
|
|
- INVENTREE_DEBUG=True
|
|
|
|
- INVENTREE_DB_ENGINE=sqlite
|
2022-04-20 15:13:34 +00:00
|
|
|
- INVENTREE_DB_NAME=/home/inventree/db.sqlite3
|
2021-12-21 05:14:04 +00:00
|
|
|
restart: unless-stopped
|
|
|
|
|
|
|
|
volumes:
|
|
|
|
# NOTE: Change "../" to a directory on your local machine, where the InvenTree source code is located
|
|
|
|
# Persistent data, stored external to the container(s)
|
|
|
|
src:
|
|
|
|
driver: local
|
|
|
|
driver_opts:
|
|
|
|
type: none
|
|
|
|
o: bind
|
|
|
|
# This directory specified where InvenTree source code is stored "outside" the docker containers
|
|
|
|
# By default, this directory is one level above the "docker" directory
|
2022-04-20 15:13:34 +00:00
|
|
|
device: ${INVENTREE_EXT_VOLUME:-../}
|