2023-08-04 00:17:08 +08:00
|
|
|
version: '3.9'
|
|
|
|
|
|
|
|
services:
|
2023-08-05 14:14:07 +08:00
|
|
|
# Django App
|
|
|
|
django_backend:
|
2023-08-04 00:17:08 +08:00
|
|
|
build:
|
|
|
|
context: .
|
|
|
|
dockerfile: Dockerfile
|
|
|
|
image: stude_backend:latest
|
|
|
|
ports:
|
2023-09-12 19:59:54 +08:00
|
|
|
- "8083:8000" # Expose port 8083 for the web server
|
2023-08-04 00:17:08 +08:00
|
|
|
environment:
|
|
|
|
- PYTHONBUFFERED=1
|
2023-09-20 04:34:41 +08:00
|
|
|
command: ["sh", "-c", "python stude/manage.py collectstatic --noinput && python stude/manage.py makemigrations && python stude/manage.py custom_migrate && python stude/manage.py runserver"]
|
2023-08-05 14:14:07 +08:00
|
|
|
volumes:
|
2023-09-12 19:26:37 +08:00
|
|
|
- .:/code # For hotreloading
|
|
|
|
depends_on:
|
|
|
|
- redis # Add this to make sure Django can reach the Redis server
|
|
|
|
|
|
|
|
# Redis Server
|
|
|
|
redis:
|
|
|
|
image: redis:latest
|
|
|
|
ports:
|
|
|
|
- "6379:6379" # Expose Redis default port
|
2023-08-04 00:17:08 +08:00
|
|
|
|
2023-08-05 14:14:07 +08:00
|
|
|
volumes:
|
|
|
|
stude:
|