2021-05-10 04:23:17 +00:00
|
|
|
version: "3.8"
|
|
|
|
|
|
|
|
# Docker compose recipe for InvenTree development server
|
|
|
|
# - Runs sqlite3 as the database backend
|
|
|
|
# - Uses built-in django webserver
|
|
|
|
|
|
|
|
# IMPORANT NOTE:
|
|
|
|
# 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-server:
|
|
|
|
container_name: inventree-server
|
2021-05-12 10:53:50 +00:00
|
|
|
build:
|
|
|
|
context: .
|
|
|
|
target: dev
|
2021-05-10 04:23:17 +00:00
|
|
|
ports:
|
|
|
|
- 8000
|
|
|
|
volumes:
|
|
|
|
# Ensure you specify the location of the 'src' directory at the end of this file
|
|
|
|
- src:/home/inventree/src
|
2021-05-12 11:15:53 +00:00
|
|
|
env_file:
|
|
|
|
# Environment variables required for the dev server are configured in dev-config.env
|
|
|
|
- dev-config.env
|
|
|
|
|
2021-05-10 04:23:17 +00:00
|
|
|
restart: unless-stopped
|
|
|
|
|
|
|
|
# Background worker process handles long-running or periodic tasks
|
|
|
|
inventree-worker:
|
|
|
|
container_name: inventree-worker
|
2021-05-12 10:53:50 +00:00
|
|
|
build:
|
|
|
|
context: .
|
|
|
|
target: dev
|
|
|
|
entrypoint: invoke worker
|
2021-05-10 04:23:17 +00:00
|
|
|
- inventree-server
|
|
|
|
volumes:
|
|
|
|
# Ensure you specify the location of the 'src' directory at the end of this file
|
2021-05-12 10:53:50 +00:00
|
|
|
- src:/home/inventree/src
|
2021-05-12 11:15:53 +00:00
|
|
|
env_file:
|
|
|
|
# Environment variables required for the dev server are configured in dev-config.env
|
|
|
|
- dev-config.env
|
2021-05-10 04:23:17 +00:00
|
|
|
restart: unless-stopped
|
|
|
|
|
|
|
|
volumes:
|
|
|
|
# NOTE: Change /path/to/src 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
|
|
|
|
# Note: This directory must conatin the file *manage.py*
|
2021-05-12 10:53:50 +00:00
|
|
|
device: /path/to/inventree/src
|