Skip to content

Commit

Permalink
Streamline docker-compose and cleanup (#76)
Browse files Browse the repository at this point in the history
  • Loading branch information
robertjndw authored Jul 24, 2023
1 parent dd67318 commit a94a19d
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 17 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.env

# User-specific stuff
.idea/**/workspace.xml
.idea/**/tasks.xml
Expand Down
7 changes: 4 additions & 3 deletions docker-compose.prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ services:

server:
image: "ghcr.io/ls1intum/prompt/prompt-server:${SERVER_IMAGE_TAG}"
container_name: orgatool-server
container_name: prompt-server
labels:
- "traefik.enable=true"
- "traefik.http.routers.server.rule=Host(`${SERVER_HOST}`) && PathPrefix(`/api`)"
Expand Down Expand Up @@ -59,7 +59,7 @@ services:

db:
image: "postgres:15.2-alpine"
container_name: db
container_name: prompt-db
environment:
- POSTGRES_USER=${SPRING_DATASOURCE_USERNAME}
- POSTGRES_PASSWORD=${SPRING_DATASOURCE_PASSWORD}
Expand All @@ -73,7 +73,7 @@ services:

client:
image: "ghcr.io/ls1intum/prompt/prompt-client:${CLIENT_IMAGE_TAG}"
container_name: orgatool-client
container_name: prompt-client
environment:
- TZ=Europe/Berlin
labels:
Expand All @@ -88,6 +88,7 @@ services:

postfix:
image: ghcr.io/ls1admin/postfix:latest
container_name: prompt-postfix
restart: unless-stopped
volumes:
- ./postfix-config:/config
Expand Down
28 changes: 16 additions & 12 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,44 +1,48 @@
services:
server:
image: 'orgatool-server:latest'
image: ghcr.io/ls1intum/prompt/prompt-server:latest
build:
context: ./server
container_name: orgatool-server
container_name: prompt-server
depends_on:
db:
condition: service_healthy
environment:
- SPRING_DATASOURCE_URL=jdbc:postgresql://db:5432/orgatool-postgres
- SPRING_DATASOURCE_USERNAME=orgatool-postgres
- SPRING_DATASOURCE_PASSWORD=postgress-orgatool
- SPRING_DATASOURCE_URL=jdbc:postgresql://db:5432/prompt
- SPRING_DATASOURCE_USERNAME=prompt-postgres
- SPRING_DATASOURCE_PASSWORD=prompt-postgres
- SPRING_JPA_HIBERNATE_DDL_AUTO=update
ports:
- "8080:8080"

db:
image: 'postgres:15.2-alpine'
container_name: db
container_name: prompt-db
environment:
- POSTGRES_USER=orgatool-postgres
- POSTGRES_PASSWORD=postgress-orgatool
- POSTGRES_USER=prompt-postgres
- POSTGRES_PASSWORD=prompt-postgres
- POSTGRES_DB=prompt
healthcheck:
test: ["CMD-SHELL", "pg_isready -d orgatool-postgres -U orgatool-postgres"]
test: ["CMD-SHELL", "pg_isready -d prompt -U prompt-postgres"]
interval: 5s
timeout: 5s
retries: 5
ports:
- "5432:5432"

client:
image: 'orgatool-client:latest'
image: ghcr.io/ls1intum/prompt/prompt-client:latest
build:
context: ./client
container_name: orgatool-client
container_name: prompt-client
depends_on:
- server
ports:
- "80:80"

postfix:
image: ghcr.io/ls1admin/postfix:latest
container_name: prompt-postfix
restart: unless-stopped
volumes:
- ./postfix-config:/config # See https://github.com/ls1admin/postfix-container-tum-mailrelay/tree/main for details
Expand All @@ -48,7 +52,7 @@ services:

keycloak:
image: quay.io/keycloak/keycloak:20.0
container_name: prompt_keycloak
container_name: prompt-keycloak
environment:
KEYCLOAK_ADMIN: admin
KEYCLOAK_ADMIN_PASSWORD: admin
Expand Down
4 changes: 2 additions & 2 deletions server/src/main/resources/application.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
spring:
datasource:
url: ${SPRING_DATASOURCE_URL:jdbc:postgresql://localhost:5432/prompt}
username: ${SPRING_DATASOURCE_USERNAME:postgres}
password: ${SPRING_DATASOURCE_PASSWORD:airelawaleria060866}
username: ${SPRING_DATASOURCE_USERNAME:prompt-postgres}
password: ${SPRING_DATASOURCE_PASSWORD:prompt-postgres}
jpa:
hibernate:
ddl-auto: update
Expand Down

0 comments on commit a94a19d

Please sign in to comment.