[fix] docker deploy

This commit is contained in:
Data-Name-ID
2024-04-02 11:46:37 +03:00
parent 6958e3934a
commit cb40fb71c8
3 changed files with 47 additions and 15 deletions
+23 -12
View File
@@ -21,12 +21,12 @@ services:
backend:
build: ./backend
container_name: backend
volumes:
- media_volume:/app/project/media/
- static_volume:/app/project/static/
depends_on:
postgres:
condition: service_healthy
restart: unless-stopped
expose:
- 8000
environment:
POSTGRES_USER: ${POSTGRES_USER:-postgres}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-postgres}
@@ -38,18 +38,28 @@ services:
DJANGO_DEBUG: ${DJANGO_DEBUG:-false}
DJANGO_ALLOWED_HOSTS: ${DJANGO_ALLOWED_HOSTS:-*}
DJANGO_INTERNAL_IPS: ${DJANGO_INTERNAL_IPS:-127.0.0.1}
command: ["sh", "-c", "cd project && python manage.py migrate && gunicorn config.wsgi:application --bind 0.0.0.0:8080"]
ports:
- 8080:8080
frontend:
container_name: frontend
expose:
- 8080
command:
[
"sh",
"-c",
"cd project && python manage.py collectstatic --noinput && python manage.py migrate && gunicorn config.wsgi:application --bind 0.0.0.0:8080",
]
nginx:
container_name: nginx
build:
context: ./frontend
dockerfile: Dockerfile
ports:
- "3000:3000"
restart: always
- "80:80"
volumes:
- ./nginx/nginx.conf:/etc/nginx/conf.d/default.conf
- media_volume:/var/html/media/
- static_volume:/var/html/static/
depends_on:
- backend
pgadmin:
image: dpage/pgadmin4:8.4
@@ -68,5 +78,6 @@ services:
volumes:
postgres_data:
redis_data:
pgadmin_data:
media_volume:
static_volume: