services: db: image: postgres:16.3 container_name: postgres restart: always volumes: - postgres_data:/var/lib/postgresql/data ports: - "5432:5432" healthcheck: test: ["CMD-SHELL", "pg_isready -U $${POSTGRES_USER} -d $${POSTGRES_DB}"] interval: 10s timeout: 5s retries: 5 networks: - app-network environment: POSTGRES_USER: ${POSTGRES_USER} POSTGRES_PASSWORD: ${POSTGRES_PASSWORD} POSTGRES_DB: ${POSTGRES_DB} backend: build: context: . dockerfile: Dockerfile image: backend container_name: backend restart: always command: /bin/sh -c "sleep 5 && venv/bin/python3 manage.py migrate --noinput && venv/bin/python3 manage.py runserver 0.0.0.0:8000" volumes: - helloword_project:/ft_transcendence/helloworld ports: - "8000:8000" depends_on: - db networks: - app-network environment: POSTGRES_DB: ${POSTGRES_DB} POSTGRES_USER: ${POSTGRES_USER} POSTGRES_PASSWORD: ${POSTGRES_PASSWORD} DB_HOST: ${DB_HOST} DB_PORT: ${DB_PORT} healthcheck: test: ["CMD-SHELL", "curl -f http://localhost:8000 || exit 1"] interval: 10s timeout: 5s retries: 5 volumes: postgres_data: driver: local driver_opts: type: none device: /home/theouche/trans/git_trans/data/db o: bind helloword_project: driver: local driver_opts: type: none device: /home/theouche/trans/git_trans/helloworld o: bind networks: app-network: driver: bridge