Skip to content

Instantly share code, notes, and snippets.

@taiwotman
Created October 5, 2022 19:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save taiwotman/018bd391044df2c192683798b85cc5b9 to your computer and use it in GitHub Desktop.
Save taiwotman/018bd391044df2c192683798b85cc5b9 to your computer and use it in GitHub Desktop.
version: "3.9"
services:
postgres:
image: postgres:10.5
restart: always
environment:
- POSTGRES_USER=<username>
- POSTGRES_PASSWORD=<password>
ports:
- '5433:5432'
volumes:
- ./postgres-data:/var/lib/postgresql/data
- ./data:/var/lib/postgresql/data_csv
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U postgres" ]
interval: 5s
timeout: 5s
retries: 5
run:
image: "<image-name>"
depends_on:
postgres:
condition: service_healthy
volumes:
- .:/app
command: python3 main.py
test:
image: "<image-name>"
depends_on:
postgres:
condition: service_healthy
volumes:
- .:/app
command: python3 -m pytest
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment