-
Notifications
You must be signed in to change notification settings - Fork 7
/
docker-compose.yml
115 lines (109 loc) · 3.77 KB
/
docker-compose.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
109
110
111
112
113
114
115
version: '2.3'
networks:
app_dev_external_network:
app_dev_internal_network:
internal: true
services:
app_dev_backend:
build:
context: ./
dockerfile: Dockerfile.develop
args:
- PACKAGE_REPO_LOGIN=${PACKAGE_REPO_LOGIN}
- PACKAGE_REPO_PASSWORD=${PACKAGE_REPO_PASSWORD}
image: ${IMAGE_NAME:-monogramm/spring-rest-api-starter}:develop
command: mvn spring-boot:run
container_name: app_dev_backend
#restart: always
healthcheck:
test: CMD curl -v --silent http://localhost:${APP_SERVER_PORT}/${APP_SERVER_CONTEXT_PATH}/health 2>&1 | grep UP
interval: 1m30s
timeout: 10s
retries: 3
#start_period: 40s
ports:
- "8080:${APP_SERVER_PORT}"
- "35729:35729"
networks:
- app_dev_internal_network
- app_dev_external_network
depends_on:
app_dev_db:
condition: service_healthy
app_dev_mailer:
condition: service_started
volumes:
# For DEV, mount local sources
- ./:/usr/src/app
# If you want, you can sync time & timezone with host
#- /etc/localtime:/etc/localtime:ro
#- /etc/timezone:/etc/timezone:ro
environment:
- SPRING_DEVTOOLS_REMOTE_SECRET=secret
- ENDPOINTS_HEALTH_SENSITIVE=false
- MANAGEMENT_SECURITY_ENABLED=false
# Application configuration
- SERVER_PORT=${APP_SERVER_PORT}
- SERVER_CONTEXT_PATH=/${APP_SERVER_CONTEXT_PATH}
- APPLICATION_EMAIL_APP_TITLE=${APP_TITLE}
- APPLICATION_DATA_DOMAIN_NAME=${APP_DOMAIN_NAME}
- APPLICATION_DATA_ADMIN_PASSWORD=${APP_ADMIN_PASSWORD}
- APPLICATION_SECURITY_SIGNING_KEY=${APP_SIGNING_KEYPAIR_PASS}
- APPLICATION_DATA_DEMO=true
# Database configuration (PostgreSQL)
- SPRING_DATASOURCE_PLATFORM=postgresql
- SPRING_DATASOURCE_URL=jdbc:postgresql://app_dev_db:5432/${APP_DB_NAME}
- SPRING_JPA_PROPERTIES_HIBERNATE_DIALECT=org.hibernate.dialect.PostgreSQLDialect
- SPRING_DATASOURCE_USERNAME=${APP_DB_USER}
- SPRING_DATASOURCE_PASSWORD=${APP_DB_PASSWORD}
# Mail configuration
- SPRING_MAIL_HOST=app_dev_mailer
- SPRING_MAIL_PORT=1025
- SPRING_MAIL_PROTOCOL=smtp
- SPRING_MAIL_USERNAME=${APP_SMTP_USER}
- SPRING_MAIL_PASSWORD=${APP_SMTP_PASSWD}
- SPRING_MAIL_PROPERTIES_MAIL_TRANSPORT_PROTOCOL=smtp
- SPRING_MAIL_PROPERTIES_MAIL_SMTP_DEBUG=false
- SPRING_MAIL_PROPERTIES_MAIL_SMTP_AUTH=false
- SPRING_MAIL_PROPERTIES_MAIL_SMTP_SSL_ENABLE=false
- SPRING_MAIL_PROPERTIES_MAIL_SMTP_STARTTLS_ENABLE=false
- SPRING_MAIL_PROPERTIES_MAIL_SMTP_TIMEOUT=8000
app_dev_db:
image: postgres:10-alpine
container_name: app_dev_db
restart: always
healthcheck:
test: ["CMD", "pg_isready", "-U", "${APP_DB_USER}"]
expose:
- '5432'
ports:
- "55432:5432"
networks:
- app_dev_internal_network
volumes:
- ${APP_HOME}_dev/postgres/data:/var/lib/postgresql/data
# If you want, you can sync time & timezone with host
#- /etc/localtime:/etc/localtime:ro
#- /etc/timezone:/etc/timezone:ro
environment:
- POSTGRES_DB=${APP_DB_NAME}
- POSTGRES_USER=${APP_DB_USER}
- POSTGRES_PASSWORD=${APP_DB_PASSWORD}
# 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)
app_dev_mailer:
image: sj26/mailcatcher:latest
hostname: app_dev_mailer
container_name: app_dev_mailer
restart: always
expose:
- '1025'
ports:
- "1080:1080"
networks:
- app_dev_internal_network
- app_dev_external_network
# If you want, you can sync time & timezone with host
#volumes:
# - /etc/localtime:/etc/localtime:ro
# - /etc/timezone:/etc/timezone:ro