Skip to content

Instantly share code, notes, and snippets.

@puilp0502
Created April 3, 2019 05:56
Show Gist options
  • Save puilp0502/3f8264b8003b451a53c1c3db0e5b4286 to your computer and use it in GitHub Desktop.
Save puilp0502/3f8264b8003b451a53c1c3db0e5b4286 to your computer and use it in GitHub Desktop.
도커 스터디
version: '2.1'
services:
db:
image: postgres:9.6.1
volumes:
- db:/var/lib/postgresql/data
environment:
- POSTGRES_DB=sampledb
- POSTGRES_USER=sampleuser
- POSTGRES_PASSWORD=samplesecret
- POSTGRES_INITDB_ARGS=--encoding=UTF-8
healthcheck:
test: "pg_isready -h localhost -p 5432 -q -U postgres"
interval: 3s
timeout: 1s
retries: 10
django:
image: puilp0502/django-sample
environment:
- DJANGO_DEBUG=True
- DJANGO_DB_HOST=db
- DJANGO_DB_PORT=5432
- DJANGO_DB_NAME=sampledb
- DJANGO_DB_USERNAME=sampleuser
- DJANGO_DB_PASSWORD=samplesecret
- DJANGO_SECRET_KEY=dev_secret_key
ports:
- "8000:8000"
depends_on:
db:
condition: service_healthy
links:
- db
command: python manage.py runserver 0.0.0.0:8000
volumes:
db:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment