Skip to content

Commit 705ff68

Browse files
committed
feat: provide support for running application with prod profile by docker-compose.
Addressed to #534 [ci skip]
1 parent c09aa64 commit 705ff68

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed

docker/prod.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# Customize configuration from docker-compose.yml to run the application with
2+
# the "prod" profile.
3+
#
4+
# In order to get the effective configuration, run
5+
# $ docker-compose -f docker-compose.yml -f prod.yml config
6+
#
7+
version: '3'
8+
9+
services:
10+
web:
11+
environment:
12+
- SPRING_PROFILES_ACTIVE=prod
13+
# localhost -> db
14+
- SPRING_DATASOURCE_URL=jdbc:mysql://db:3306/mystamps?logger=com.mysql.jdbc.log.Slf4JLogger&useSSL=false&logSlowQueries=true&slowQueryThresholdMillis=250&autoSlowLog=false&characterEncoding=UTF-8
15+
# override password from application-prod.properties to be the same as in db
16+
- SPRING_DATASOURCE_PASSWORD=secret
17+
# only for testing locally. See also: https://github.com/php-coder/mystamps/issues/670
18+
- SERVER_SESSION_COOKIE_SECURE=false
19+
volumes:
20+
- ./application-prod.properties:/data/mystamps/application-prod.properties:ro
21+
networks:
22+
- internal-network
23+
depends_on:
24+
- db
25+
db:
26+
image: mysql:5.7.20
27+
command: --character-set-server=utf8
28+
environment:
29+
# the generated root password will be printed to stdout (GENERATED ROOT PASSWORD: ...)
30+
- MYSQL_RANDOM_ROOT_PASSWORD=true
31+
- MYSQL_USER=mystamps
32+
# TODO: try to use a secret
33+
- MYSQL_PASSWORD=secret
34+
# the user specified above will be granted superuser access automatically
35+
- MYSQL_DATABASE=mystamps
36+
ports:
37+
- "3306:3306"
38+
# only for testing locally
39+
#volumes:
40+
# - ./mysql_backup_mystamps_20180901-003001.sql.gz:/docker-entrypoint-initdb.d/dump.sql.gz:ro
41+
networks:
42+
- internal-network
43+
44+
networks:
45+
internal-network:

0 commit comments

Comments
 (0)