forked from inventree/InvenTree
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
71 lines (64 loc) · 2.41 KB
/
docker-compose.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
version: "3.8"
# Docker compose recipe for InvenTree development server
# - Runs PostgreSQL as the database backend
# - Uses built-in django webserver
# - Runs the InvenTree background worker process
# - Serves media and static content directly from Django webserver
# IMPORANT NOTE:
# The InvenTree development image does not clone source code from git.
# Instead, it runs from source code on your local machine.
# The django server will auto-detect any code changes and reload the server.
# If you have cloned the InvenTree git repo, and not made any changes to this file,
# then the default setup in this file should work straight out of the box, without modification
services:
# Database service
# Use PostgreSQL as the database backend
# Note: This can be changed to a different backend if required
inventree-dev-db:
container_name: inventree-dev-db
image: postgres:13
expose:
- 5432/tcp
environment:
- PGDATA=/var/lib/postgresql/data/pgdb
- POSTGRES_USER=pguser
- POSTGRES_PASSWORD=pgpassword
- POSTGRES_DB=inventree
volumes:
# Map 'data' volume such that postgres database is stored externally
- ./data:/var/lib/postgresql/data:z
restart: unless-stopped
# InvenTree web server service
# Runs the django built-in webserver application
inventree-dev-server:
container_name: inventree-dev-server
depends_on:
- inventree-dev-db
build: &build_config
context: .
target: dev
# Cache the built image to be used by the inventree-dev-worker process
image: inventree-dev-image
ports:
# Expose web server on port 8000
- 8000:8000
volumes:
# Mount local source directory to /home/inventree
- ./:/home/inventree:z
env_file:
- docker.dev.env
restart: unless-stopped
# Background worker process handles long-running or periodic tasks
inventree-dev-worker:
container_name: inventree-dev-worker
image: inventree-dev-image
build: *build_config
command: invoke worker
depends_on:
- inventree-dev-server
volumes:
# Mount local source directory to /home/inventree
- ./:/home/inventree:z
env_file:
- docker.dev.env
restart: unless-stopped