42 lines
995 B
YAML
42 lines
995 B
YAML
|
version: '3.1'
|
||
|
|
||
|
services:
|
||
|
|
||
|
db:
|
||
|
image: mariadb:latest
|
||
|
container_name: template_mysql
|
||
|
environment:
|
||
|
MYSQL_ROOT_PASSWORD: edkvcjReDxJ9Z8hq
|
||
|
backend:
|
||
|
build:
|
||
|
context: ./backend
|
||
|
dockerfile: Dockerfile
|
||
|
links:
|
||
|
- "db:app_db"
|
||
|
environment:
|
||
|
SPRING_DATASOURCE_USERNAME: root
|
||
|
SPRING_DATASOURCE_PASSWORD: edkvcjReDxJ9Z8hq
|
||
|
SPRING_DATASOURCE_URL: jdbc:mariadb://app_db:3306/restservice?createDatabaseIfNotExist=true&autoReconnect=true
|
||
|
depends_on:
|
||
|
- "db"
|
||
|
restart: always
|
||
|
frontend:
|
||
|
build:
|
||
|
context: ./frontend
|
||
|
dockerfile: Dockerfile
|
||
|
restart: always
|
||
|
links:
|
||
|
- backend:backend
|
||
|
ports:
|
||
|
- "4200:80"
|
||
|
environment:
|
||
|
# change this env-variable in prod
|
||
|
BACKEND_URL: http://backend/
|
||
|
# alternative way manipulate the api.json:
|
||
|
#{
|
||
|
# "api": "http://backend/"
|
||
|
#}
|
||
|
# bind-mount it read-only via:
|
||
|
#volumes:
|
||
|
# - ./api.json:/usr/share/nginx/html/assets/api.json:ro
|