Dockerized the application (#119)

* dockerized the application

* Update docker.md

---------

Co-authored-by: Horilla <131998600+horilla-opensource@users.noreply.github.com>
This commit is contained in:
Ashwanth Balakrishnan
2024-03-13 11:51:23 +05:30
committed by GitHub
parent 606f77da71
commit 03ff0aec9c
7 changed files with 84 additions and 0 deletions

38
docker-compose.yaml Normal file
View File

@@ -0,0 +1,38 @@
version: '3.8'
services:
server:
build:
context: .
dockerfile: Dockerfile
ports:
- 8000:8000
restart: unless-stopped
environment:
DATABASE_URL: "postgres://postgres:postgres@db:5432/horilla"
command: ./entrypoint.sh
depends_on:
db:
condition: service_healthy
db:
image: postgres:16-bullseye
environment:
POSTGRES_DB: horilla
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
ports:
- 5432:5432
restart: unless-stopped
volumes:
- horilla-data:/var/lib/postgresql/data
healthcheck:
test: ["CMD", "pg_isready", "-U", "postgres"]
interval: 10s
timeout: 5s
retries: 5
volumes:
horilla-data: