2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-12 01:55:39 +00:00

Simplify dockerfile / docker-compose

- Single data volume now also includes 'static' files
- InvenTree source repo is now cloned into /home/inventree (to match the "dev" image)
This commit is contained in:
Oliver Walters
2021-06-16 22:36:05 +10:00
parent acd7322ff0
commit 7dd63b36da
4 changed files with 27 additions and 23 deletions

View File

@ -30,6 +30,7 @@ services:
- POSTGRES_USER=pguser
- POSTGRES_PASSWORD=pgpassword
volumes:
# Map 'data' volume such that postgres database is stored externally
- data:/var/lib/postgresql/data/
restart: unless-stopped
@ -43,8 +44,8 @@ services:
depends_on:
- inventree-db
volumes:
# Map 'data' volume
- data:/home/inventree/data
- static:/home/inventree/static
environment:
# Default environment variables are configured to match the 'db' container
# Note: If you change the database image, these will need to be adjusted
@ -67,7 +68,6 @@ services:
- inventree-server
volumes:
- data:/home/inventree/data
- static:/home/inventree/static
environment:
# Default environment variables are configured to match the 'db' container
# Note: If you change the database image, these will need to be adjusted
@ -81,7 +81,8 @@ services:
restart: unless-stopped
# nginx acts as a reverse proxy
# static files are served by nginx
# static files are served directly by nginx
# media files are served by nginx, although authentication is redirected to inventree-server
# web requests are redirected to gunicorn
# NOTE: You will need to provide a working nginx.conf file!
inventree-proxy:
@ -93,11 +94,11 @@ services:
# Change "1337" to the port that you want InvenTree web server to be available on
- 1337:80
volumes:
# Provide nginx.conf file to the container
# Provide ./nginx.conf file to the container
# Refer to the provided example file as a starting point
- ./nginx.conf:/etc/nginx/conf.d/default.conf:ro
# Static data volume is mounted to /var/www/static
- static:/var/www/static:ro
# nginx proxy needs access to static and media files
- data:/var/www
restart: unless-stopped
volumes:
@ -110,6 +111,4 @@ volumes:
o: bind
# This directory specified where InvenTree data are stored "outside" the docker containers
# Change this path to a local system path where you want InvenTree data stored
device: /path/to/data
# Static files, shared between containers
static:
device: /path/to/data