Set the names of the containers in dev compose

This commit is contained in:
gw3000 2023-08-26 15:22:09 +02:00
parent 0376b9122d
commit 811a690d39

View file

@ -3,6 +3,7 @@ version: '3.8'
services: services:
web: web:
build: ./app build: ./app
container_name: django_fbf_web_1
command: > command: >
bash -c 'while !</dev/tcp/db/5432; do sleep 1; done; bash -c 'while !</dev/tcp/db/5432; do sleep 1; done;
python manage.py makemigrations; python manage.py makemigrations;
@ -33,8 +34,10 @@ services:
labels: labels:
- "traefik.enable=true" - "traefik.enable=true"
- "traefik.http.routers.django.rule=Host(`${ALLOWED_HOSTS}`)" - "traefik.http.routers.django.rule=Host(`${ALLOWED_HOSTS}`)"
db: db:
image: postgres:15-alpine image: postgres:15-alpine
container_name: django_fbf_db_1
volumes: volumes:
- ./postgres/data:/var/lib/postgresql/data/ - ./postgres/data:/var/lib/postgresql/data/
- ./postgres/backup:/backup - ./postgres/backup:/backup
@ -44,8 +47,10 @@ services:
- "POSTGRES_USER=${DB_USER}" - "POSTGRES_USER=${DB_USER}"
- "POSTGRES_PASSWORD=${DB_PASSWORD}" - "POSTGRES_PASSWORD=${DB_PASSWORD}"
- "POSTGRES_DB=${DB_NAME}" - "POSTGRES_DB=${DB_NAME}"
traefik: traefik:
image: traefik:v2.9.6 image: traefik:v2.9.6
container_name: django_fbf_traefik_1
ports: ports:
- 8008:80 - 8008:80
- 8081:8080 - 8081:8080