generated from cloudoperators/repository-template
-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.yaml
55 lines (52 loc) · 1.65 KB
/
docker-compose.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company and Greenhouse contributors
# SPDX-License-Identifier: Apache-2.0
# This docker-compose file is used to run the application localy in containarized environment.
# ensure to set .env file accordingly
services:
heureka-db:
image: mariadb:latest
container_name: mariadb
restart: always
profiles:
- db
environment:
MARIADB_USER: ${DB_USER}
MARIADB_PASSWORD: ${DB_PASSWORD}
MARIADB_DATABASE: ${DB_NAME}
MARIADB_ROOT_PASSWORD: ${DB_ROOT_PASSWORD}
# Uncomment the following lines and comment the MARIADB_ROOT_PASSWORD line to use other options
# - MARIADB_ROOT_PASSWORD_HASH=*HASHED_PASSWORD
# - MARIADB_ALLOW_EMPTY_ROOT_PASSWORD=yes
# - MARIADB_RANDOM_ROOT_PASSWORD=yes
healthcheck:
test: [ "CMD", "healthcheck.sh", "--connect", "--innodb_initialized" ]
start_period: 10s
interval: 10s
timeout: 5s
retries: 3
volumes:
- ./.db/data:/var/lib/mysql
- ./internal/database/mariadb/init/schema.sql:/docker-entrypoint-initdb.d/schema.sql
ports:
- "3306:3306"
heureka-app:
build: .
container_name: heureka-app
profiles:
- heureka
environment:
DB_ADDRESS: heureka-db
DB_PORT: 3306
DB_USER: ${DB_USER}
DB_PASSWORD: ${DB_PASSWORD}
DB_ROOT_PASSWORD: ${DB_PASSWORD}
DB_NAME: ${DB_NAME}
DB_SCHEMA: /app_sqlschema/schema.sql
SEED_MODE: ${SEED_MODE}
volumes:
- ./internal/database/mariadb/init/schema.sql:/app_sqlschema/schema.sql
depends_on:
heureka-db:
condition: service_healthy
ports:
- "80:80"