mirror of
https://github.com/inventree/InvenTree.git
synced 2025-06-12 01:55:39 +00:00
Development docker image
- Uses multistage build - Adds a docker compose file for dev
This commit is contained in:
70
docker/docker-compose.dev.yml
Normal file
70
docker/docker-compose.dev.yml
Normal file
@ -0,0 +1,70 @@
|
||||
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
|
||||
image: inventree/inventree:latest
|
||||
entrypoint: ./start_dev_server.sh
|
||||
ports:
|
||||
- 8000
|
||||
depends_on:
|
||||
- inventree-db
|
||||
volumes:
|
||||
# Ensure you specify the location of the 'src' directory at the end of this file
|
||||
- src:/home/inventree/src
|
||||
- data:/home/inventree/data
|
||||
- static:/home/inventree/static
|
||||
environment:
|
||||
# Configure a simple sqlite server for development
|
||||
# Note: You can always change to a different database backend if required!
|
||||
- INVENTREE_DB_ENGINE=sqlite
|
||||
- INVENTREE_DB_NAME=inventree
|
||||
restart: unless-stopped
|
||||
|
||||
# Background worker process handles long-running or periodic tasks
|
||||
inventree-worker:
|
||||
container_name: inventree-worker
|
||||
image: inventree/inventree:latest
|
||||
entrypoint: ./start_worker.sh
|
||||
depends_on:
|
||||
- inventree-db
|
||||
- inventree-server
|
||||
volumes:
|
||||
# Ensure you specify the location of the 'src' directory at the end of this file
|
||||
- data:/home/inventree/data
|
||||
- static:/home/inventree/static
|
||||
environment:
|
||||
# Configure a simple sqlite server for development
|
||||
# Note: You can always change to a different database backend if required!
|
||||
- INVENTREE_DB_ENGINE=sqlite
|
||||
- INVENTREE_DB_NAME=inventree
|
||||
restart: unless-stopped
|
||||
|
||||
volumes:
|
||||
# NOTE: Change /path/to/src to a directory on your local machine, where the InvenTree source code is located
|
||||
# This directory must conatin the file *manage.py*
|
||||
# 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*
|
||||
device: /path/to/src
|
||||
# Uploaded data / media files, shared between containers
|
||||
data:
|
||||
# Static files, shared between containers
|
||||
static:
|
Reference in New Issue
Block a user