diff --git a/docker-compose.yaml b/docker-compose.yaml new file mode 100644 index 0000000..e9e2e9a --- /dev/null +++ b/docker-compose.yaml @@ -0,0 +1,22 @@ +services: + messages_db: + image: postgres:latest + environment: + - POSTGRES_USER=${POSTGRES_USER:-postgres} + - POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-postgres} + - POSTGRES_DB=${POSTGRES_DB:-messages} + ports: + - "5432:5432" + volumes: + - data:/var/lib/postgresql + healthcheck: + test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-postgres} -d ${POSTGRES_DB:-messages}"] + interval: 5s + timeout: 5s + retries: 5 + start_period: 10s + env_file: + - .env + +volumes: + data: \ No newline at end of file