cleaned up docker-compose files
This commit is contained in:
parent
34d05ea7be
commit
2157ed5a97
2 changed files with 13 additions and 6 deletions
|
@ -5,7 +5,11 @@ services:
|
||||||
build:
|
build:
|
||||||
context: ./app
|
context: ./app
|
||||||
dockerfile: Dockerfile.prod
|
dockerfile: Dockerfile.prod
|
||||||
command: bash -c 'while !</dev/tcp/db/5432; do sleep 1; done; python manage.py collectstatic; gunicorn --bind 0.0.0.0:8000 core.wsgi'
|
command: >
|
||||||
|
bash -c 'while !</dev/tcp/db/5432; do sleep 1; done;
|
||||||
|
python manage.py migrate;
|
||||||
|
python manage.py collectstatic --no-input --no-post-process;
|
||||||
|
gunicorn --bind 0.0.0.0:8000 core.wsgi'
|
||||||
expose:
|
expose:
|
||||||
- 8000
|
- 8000
|
||||||
environment:
|
environment:
|
||||||
|
@ -17,13 +21,12 @@ services:
|
||||||
- "DB_PORT=${DB_PORT}"
|
- "DB_PORT=${DB_PORT}"
|
||||||
- "DB_USER=${DB_USER}"
|
- "DB_USER=${DB_USER}"
|
||||||
- "DEBUG=${DEBUG}"
|
- "DEBUG=${DEBUG}"
|
||||||
- "DJANGO_ALLOWED_HOSTS=${DJANGO_ALLOWED_HOSTS}"
|
|
||||||
- "SECRET_KEY=${SECRET_KEY}"
|
- "SECRET_KEY=${SECRET_KEY}"
|
||||||
depends_on:
|
depends_on:
|
||||||
- db
|
- db
|
||||||
labels:
|
labels:
|
||||||
- "traefik.enable=true"
|
- "traefik.enable=true"
|
||||||
- "traefik.http.routers.django.rule=Host(`${DJANGO_ALLOWED_HOSTS}`)"
|
- "traefik.http.routers.django.rule=Host(`${ALLOWED_HOSTS}`)"
|
||||||
- "traefik.http.routers.django.tls=true"
|
- "traefik.http.routers.django.tls=true"
|
||||||
- "traefik.http.routers.django.tls.certresolver=letsencrypt"
|
- "traefik.http.routers.django.tls.certresolver=letsencrypt"
|
||||||
db:
|
db:
|
||||||
|
|
|
@ -3,7 +3,12 @@ version: '3.8'
|
||||||
services:
|
services:
|
||||||
web:
|
web:
|
||||||
build: ./app
|
build: ./app
|
||||||
command: bash -c 'while !</dev/tcp/db/5432; do sleep 1; done; python manage.py makemigrations; python manage.py migrate; python manage.py runserver 0.0.0.0:8000'
|
command: >
|
||||||
|
bash -c 'while !</dev/tcp/db/5432; do sleep 1; done;
|
||||||
|
python manage.py makemigrations;
|
||||||
|
python manage.py migrate;
|
||||||
|
python manage.py collectstatic --no-input --no-post-process;
|
||||||
|
python manage.py runserver 0.0.0.0:8000'
|
||||||
volumes:
|
volumes:
|
||||||
- ./app:/app
|
- ./app:/app
|
||||||
expose:
|
expose:
|
||||||
|
@ -17,13 +22,12 @@ services:
|
||||||
- "DB_PORT=${DB_PORT}"
|
- "DB_PORT=${DB_PORT}"
|
||||||
- "DB_USER=${DB_USER}"
|
- "DB_USER=${DB_USER}"
|
||||||
- "DEBUG=${DEBUG}"
|
- "DEBUG=${DEBUG}"
|
||||||
- "DJANGO_ALLOWED_HOSTS=${DJANGO_ALLOWED_HOSTS}"
|
|
||||||
- "SECRET_KEY=${SECRET_KEY}"
|
- "SECRET_KEY=${SECRET_KEY}"
|
||||||
depends_on:
|
depends_on:
|
||||||
- db
|
- db
|
||||||
labels:
|
labels:
|
||||||
- "traefik.enable=true"
|
- "traefik.enable=true"
|
||||||
- "traefik.http.routers.django.rule=Host(`${DJANGO_ALLOWED_HOSTS}`)"
|
- "traefik.http.routers.django.rule=Host(`${ALLOWED_HOSTS}`)"
|
||||||
db:
|
db:
|
||||||
image: postgres:15-alpine
|
image: postgres:15-alpine
|
||||||
volumes:
|
volumes:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue