-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathcompose.yaml
More file actions
79 lines (75 loc) · 2.74 KB
/
Copy pathcompose.yaml
File metadata and controls
79 lines (75 loc) · 2.74 KB
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
services:
myapp-db:
image: mariadb:12.2
container_name: springuser-db
volumes:
- userdb:/var/lib/mysql
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: springuser
MYSQL_USER: springuser
MYSQL_PASSWORD: springuser
MYSQL_TCP_PORT: 3306
ports:
- "3306:3306"
healthcheck:
test: [ "CMD", "healthcheck.sh", "--connect", "--innodb_initialized" ]
start_period: 1m
start_interval: 10s
interval: 1m
timeout: 5s
retries: 3
mailpit:
image: axllent/mailpit:v1.30.7
container_name: springuser-mail
ports:
# Web inbox. Open http://localhost:8025 to read the verification and password-reset mail the
# app sends. SMTP (1025) is not published: only the app container needs to reach it.
- "8025:8025"
environment:
MP_MAX_MESSAGES: 5000
# The app connects without auth (see SPRING_MAIL_* below). These two keep Mailpit accepting the
# message if you point a client at it that insists on AUTH over a plaintext connection.
MP_SMTP_AUTH_ACCEPT_ANY: 1
MP_SMTP_AUTH_ALLOW_INSECURE: 1
healthcheck:
# No curl in the image (Alpine + busybox, so wget/nc exist but curl doesn't). `mailpit readyz`
# is what the image bakes into its own default HEALTHCHECK; this override just makes it explicit.
test: ["CMD", "/mailpit", "readyz"]
interval: 10s
timeout: 5s
retries: 5
myapp-main:
image: spring-user-framework-demo
container_name: springuser-app
build:
context: .
dockerfile: Dockerfile
depends_on:
myapp-db:
condition: service_healthy
mailpit:
condition: service_healthy
ports:
- "8080:8080"
environment:
SPRING_DATASOURCE_URL: jdbc:mariadb://myapp-db:3306/springuser?createDatabaseIfNotExist=true
SPRING_DATASOURCE_USERNAME: springuser
SPRING_DATASOURCE_PASSWORD: springuser
SPRING_PROFILES_ACTIVE: dev
# Mailpit captures everything the app sends and shows it at http://localhost:8025. It speaks
# plain SMTP on 1025 with no auth and no STARTTLS, so verification and password-reset mail is
# readable without any credentials. Registration verification is left at its base default of
# true (application.yml:113): register, open the web inbox, click the link, log in.
SPRING_MAIL_HOST: mailpit
SPRING_MAIL_PORT: 1025
SPRING_MAIL_PROPERTIES_MAIL_SMTP_AUTH: "false"
SPRING_MAIL_PROPERTIES_MAIL_SMTP_STARTTLS_ENABLE: "false"
SPRING_MAIL_PROPERTIES_MAIL_SMTP_STARTTLS_REQUIRED: "false"
healthcheck:
test: ["CMD", "wget", "-q", "--spider", "http://localhost:8080/actuator/health"]
interval: 30s
timeout: 10s
retries: 5
volumes:
userdb: