-
Notifications
You must be signed in to change notification settings - Fork 7
/
docker-compose.h2.test.yml
108 lines (102 loc) · 3.12 KB
/
docker-compose.h2.test.yml
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
version: '2.3'
networks:
app_external_network:
app_internal_network:
internal: true
services:
app_backend:
build:
context: ./
dockerfile: ${DOCKERFILE_PATH}
args:
- VERSION=${TAG}
- VCS_REF=${VCS_REF}
- BUILD_DATE=${BUILD_DATE}
image: ${IMAGE_NAME}
container_name: app_backend
# [TODO] Enable auto-restart when production-ready
#restart: always
healthcheck:
test: CMD curl -v --silent http://localhost:${APP_SERVER_PORT}/${APP_SERVER_CONTEXT_PATH}/health 2>&1 | grep UP
ports:
- "8080:${APP_SERVER_PORT}"
networks:
- app_internal_network
- app_external_network
depends_on:
app_mailer:
condition: service_started
volumes:
- ${APP_HOME}_h2/back/logs:/srv/app/logs
- ${APP_HOME}_h2/back/keys:/srv/app/keys
- ${APP_HOME}_h2/back/config:/srv/app/config
- ${APP_HOME}_h2/back/data:/srv/app/data
# If you want, you can sync time & timezone with host
#- /etc/localtime:/etc/localtime:ro
#- /etc/timezone:/etc/timezone:ro
environment:
# Application configuration
- APP_SERVER_PORT=${APP_SERVER_PORT}
- APP_SERVER_CONTEXT_PATH=/${APP_SERVER_CONTEXT_PATH}
- APP_TITLE=${APP_TITLE}
- APP_DOMAIN_NAME=${APP_DOMAIN_NAME}
- APP_ADMIN_PASSWORD=${APP_ADMIN_PASSWORD}
- APP_SIGNING_KEY=
- APP_SIGNING_KEYPAIR_PASS=${APP_SIGNING_KEYPAIR_PASS}
- APP_DEMO_DATA=true
# Log configuration
- LOG_LEVEL=INFO
# Database configuration (H2)
- DB_PLATFORM=h2
- DB_NAME=${APP_DB_NAME}
- DB_USER=${APP_DB_USER}
- DB_PASSWORD=${APP_DB_PASSWORD}
# Mail configuration
- MAIL_HOST=app_mailer
- MAIL_PORT=1025
- MAIL_PROTOCOL=smtp
- MAIL_USER=${APP_SMTP_USER}
- MAIL_PASSWORD=${APP_SMTP_PASSWD}
- MAIL_SSL=false
- MAIL_STARTTLS=false
# You can also add a web server (like NGinx or Apache) to serve as reverse proxy and enforce HTTPS
# Test services (do not use in production)
# https://docs.docker.com/docker-hub/builds/automated-testing/
sut:
build:
context: ./docker/test
dockerfile: Dockerfile
command: sh /docker_test.sh
networks:
- app_internal_network
- app_external_network
depends_on:
app_backend:
condition: service_started
environment:
- DOCKER_TEST_CONTAINER=app_backend
- DOCKER_WEB_CONTAINER=app_backend
- DOCKER_WEB_PORT=${APP_SERVER_PORT}
- DOCKER_WEB_HEALTH_API=${APP_SERVER_CONTEXT_PATH}/health
volumes_from:
- app_backend
# If you want, you can sync time & timezone with host
#volumes:
# - /etc/localtime:/etc/localtime:ro
# - /etc/timezone:/etc/timezone:ro
app_mailer:
image: sj26/mailcatcher:latest
hostname: app_mailer
container_name: app_mailer
restart: always
expose:
- '1025'
ports:
- "1080:1080"
networks:
- app_internal_network
- app_external_network
# If you want, you can sync time & timezone with host
#volumes:
# - /etc/localtime:/etc/localtime:ro
# - /etc/timezone:/etc/timezone:ro