This commit is contained in:
2024-06-04 22:08:15 +02:00
commit e899252f31
74 changed files with 1969 additions and 0 deletions

56
docker-compose.yml Normal file
View File

@@ -0,0 +1,56 @@
services:
redis:
image: redis:alpine
restart: unless-stopped
app:
image: app
build:
context: ./app
args:
ENV: ${ENV}
PUID: ${USER_ID}
PGID: ${GROUP_ID}
env_file:
- .env
# user: "${USER_ID}:${GROUP_ID}"
volumes:
- ./app:/app
- ./backups:/backups
- /app/frontend/node_modules
restart: unless-stopped
ports:
- "${LISTEN_PORT:-8000}:8000"
command: >
bash -c "cd frontend && yarn build && cd ..
&& python manage.py collectstatic --noinput
&& python manage.py migrate
&& uvicorn app.asgi:application --workers 3 --host 0.0.0.0 --port 8000"
tasks:
image: app
volumes_from:
- app
env_file:
- .env
# user: "${USER_ID}:${GROUP_ID}"
restart: unless-stopped
depends_on:
- app
command: >
bash -c "sleep 5
&& celery -A app worker --loglevel=info"
jobs:
image: app
volumes_from:
- app
env_file:
- .env
# user: "${USER_ID}:${GROUP_ID}"
restart: unless-stopped
depends_on:
- app
command: >
bash -c "sleep 5
&& celery -A app beat --scheduler django_celery_beat.schedulers:DatabaseScheduler --loglevel=info"