2023-12-03 00:08:10 +08:00
|
|
|
version: "3.9"
|
|
|
|
|
|
|
|
services:
|
|
|
|
# Django App
|
2024-01-07 02:54:56 +08:00
|
|
|
django_csm_backend:
|
2023-12-03 00:08:10 +08:00
|
|
|
build:
|
|
|
|
context: .
|
|
|
|
dockerfile: Dockerfile
|
2024-01-05 21:09:54 +08:00
|
|
|
image: csm_equipment_tracker:latest
|
2023-12-03 00:08:10 +08:00
|
|
|
ports:
|
2024-01-07 02:43:15 +08:00
|
|
|
- "8092:8000"
|
2023-12-03 00:08:10 +08:00
|
|
|
environment:
|
|
|
|
- PYTHONBUFFERED=1
|
|
|
|
command:
|
|
|
|
[
|
|
|
|
"sh",
|
|
|
|
"-c",
|
2024-01-07 02:28:14 +08:00
|
|
|
"python equipment_tracker/manage.py collectstatic --noinput && python equipment_tracker/manage.py spectacular --color --file equipment_tracker/schema.yml && python equipment_tracker/manage.py makemigrations && python equipment_tracker/manage.py migrate && python equipment_tracker/manage.py runserver 0.0.0.0:8000",
|
2023-12-03 00:08:10 +08:00
|
|
|
]
|
|
|
|
volumes:
|
|
|
|
- .:/code # For hotreloading
|
2024-01-07 02:28:14 +08:00
|
|
|
depends_on:
|
|
|
|
- memcached
|
|
|
|
- postgres
|
|
|
|
|
|
|
|
memcached:
|
|
|
|
image: memcached
|
|
|
|
ports:
|
|
|
|
- "11211:11211"
|
|
|
|
entrypoint:
|
|
|
|
- memcached
|
2024-01-07 02:40:49 +08:00
|
|
|
- -m 128
|
|
|
|
- -I 10m
|
2024-01-07 02:28:14 +08:00
|
|
|
|
|
|
|
postgres:
|
|
|
|
image: postgres
|
|
|
|
volumes:
|
|
|
|
- ./postgres_data:/var/lib/postgresql/data
|
|
|
|
environment:
|
|
|
|
- POSTGRES_DB=${DB_NAME}
|
|
|
|
- POSTGRES_USER=${DB_USER}
|
|
|
|
- POSTGRES_PASSWORD=${DB_PASSWORD}
|
|
|
|
ports:
|
|
|
|
- "5432:5432"
|
2024-01-05 21:09:54 +08:00
|
|
|
|
2023-12-03 00:08:10 +08:00
|
|
|
volumes:
|
2024-01-05 21:09:54 +08:00
|
|
|
csm_equipment_tracker:
|