Add docker-compose and entrypoint

This commit is contained in:
Seamus Johnston 2022-08-10 11:11:36 -05:00
parent edf54a88a7
commit 640b8cdf1e
No known key found for this signature in database
GPG key ID: 2F21225985069105
2 changed files with 91 additions and 0 deletions

35
src/docker-compose.yml Normal file
View file

@ -0,0 +1,35 @@
version: "3.0"
services:
app:
build: .
volumes:
- ./app:/app
links:
- db
working_dir: /app
entrypoint: python /app/docker_entrypoint.py
deploy:
restart_policy:
condition: on-failure
max_attempts: 5
environment:
# Ensure stdout and stderr are sent straight to the terminal without buffering
- PYTHONUNBUFFERED=yup
# In case we'd like to know
- RUNNING_IN_DOCKER=yup
# How to connect to Postgre container
- DATABASE_URL=postgres://user:feedabee@db/app
# Run in development mode on our local
- DJANGO_SETTINGS_MODULE=app.settings.dev
stdin_open: true
tty: true
ports:
- "8000:8000"
command: "python"
db:
image: postgres:latest
environment:
- POSTGRES_DB=app
- POSTGRES_USER=user
- POSTGRES_PASSWORD=feedabee