Skip to content

Commit 015520c

Browse files
leandroBorgesFerreiraLeandro Ferreira
andauthored
Docker compose for backend (#445)
* adding docker compose * Update docker-compose.yml * Update docker-compose.yml --------- Co-authored-by: Leandro Ferreira <[email protected]>
1 parent f6038f0 commit 015520c

3 files changed

Lines changed: 51 additions & 0 deletions

File tree

docker/postgres/Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,7 @@ up:
55
docker-compose -f $(COMPOSE_FILE) up -d
66

77
down:
8+
docker-compose down
9+
10+
down-purge:
811
docker-compose down -v

docker/system/Makefile

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
PROJECT_NAME := writeopia
2+
COMPOSE_FILE := docker-compose.yml
3+
4+
up:
5+
docker-compose -f $(COMPOSE_FILE) up -d
6+
7+
down:
8+
docker-compose down
9+
10+
down-purge:
11+
docker-compose down -v

docker/system/docker-compose.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
services:
2+
postgres:
3+
image: postgres:latest
4+
container_name: writeopia-postgres
5+
environment:
6+
POSTGRES_USER: postgres
7+
POSTGRES_PASSWORD: postgres
8+
POSTGRES_DB: writeopia
9+
ports:
10+
- "5432:5432"
11+
volumes:
12+
- postgres_data:/var/lib/postgresql/data
13+
- ./init.sql:/docker-entrypoint-initdb.d/init.sql:ro
14+
restart: unless-stopped
15+
gateway:
16+
image: ghcr.io/writeopia/writeopia-backend:latest
17+
container_name: writeopia-backend
18+
depends_on:
19+
- postgres
20+
ports:
21+
- "8080:8080" # Map container's port 8080 to host port 8080
22+
environment:
23+
DATABASE_URL: jdbc:postgresql://postgres:5432/writeopia
24+
DATABASE_USER: postgres
25+
DATABASE_PASSWORD: postgres
26+
restart: unless-stopped
27+
# ai-hub:
28+
# image: ghcr.io/writeopia/writeopia-ai-hub:latest
29+
# container_name: writeopia-ai-hub
30+
# ports:
31+
# - "8000:8000"
32+
# restart: unless-stopped
33+
34+
volumes:
35+
postgres_data:
36+
37+

0 commit comments

Comments
 (0)