docker: prevent ports being exposed outside container context (#3351)

This commit is contained in:
Oliver 2022-07-18 14:08:33 +10:00 committed by GitHub
parent 7549d033df
commit f23cef0400
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 6 deletions

View File

@ -22,7 +22,7 @@ services:
inventree-dev-db: inventree-dev-db:
container_name: inventree-dev-db container_name: inventree-dev-db
image: postgres:13 image: postgres:13
ports: expose:
- ${INVENTREE_DB_PORT:-5432}/tcp - ${INVENTREE_DB_PORT:-5432}/tcp
environment: environment:
- PGDATA=/var/lib/postgresql/data/dev/pgdb - PGDATA=/var/lib/postgresql/data/dev/pgdb

View File

@ -45,7 +45,7 @@ services:
inventree-db: inventree-db:
container_name: inventree-db container_name: inventree-db
image: postgres:13 image: postgres:13
ports: expose:
- ${INVENTREE_DB_PORT:-5432}/tcp - ${INVENTREE_DB_PORT:-5432}/tcp
environment: environment:
- PGDATA=/var/lib/postgresql/data/pgdb - PGDATA=/var/lib/postgresql/data/pgdb
@ -65,9 +65,9 @@ services:
- inventree-db - inventree-db
env_file: env_file:
- .env - .env
ports: expose:
- ${INVENTREE_CACHE_PORT:-6379}:6379 - ${INVENTREE_CACHE_PORT:-6379}
restart: unless-stopped restart: always
# InvenTree web server services # InvenTree web server services
# Uses gunicorn as the web server # Uses gunicorn as the web server
@ -126,7 +126,6 @@ services:
restart: unless-stopped restart: unless-stopped
volumes: volumes:
# NOTE: Change /path/to/data to a directory on your local machine
# Persistent data, stored external to the container(s) # Persistent data, stored external to the container(s)
inventree_data: inventree_data:
driver: local driver: local