projet-application-web/docker/docker-compose.yml

54 lines
1.3 KiB
YAML
Raw Normal View History

2022-05-07 15:19:33 +00:00
version: "3"
2022-04-21 07:48:10 +00:00
services:
2022-05-10 20:22:52 +00:00
app:
2022-05-07 15:19:33 +00:00
hostname: wildfly
container_name: wildfly
2022-05-10 20:22:52 +00:00
build:
context: .
network: host
2022-04-21 07:48:10 +00:00
environment:
2022-05-07 14:35:50 +00:00
- WILDFLY_USER=${WILDFLY_ADMIN_USER}
- WILDFLY_PASS=${WILDFLY_ADMIN_PASS}
- DB_NAME=${MYSQL_DATABASE}
- DB_USER=${MYSQL_USER}
- DB_PASS=${MYSQL_PASSWORD}
2022-05-10 20:22:52 +00:00
- DB_URI=db:3306
2022-05-07 14:35:50 +00:00
volumes:
2022-05-10 20:22:52 +00:00
- ../build/libs/:/opt/jboss/wildfly/standalone/deployments/
2022-04-21 08:06:30 +00:00
ports:
2022-05-07 14:35:50 +00:00
- "8080:8080" # application
- "9990:9990" # admin console
2022-05-10 20:22:52 +00:00
depends_on:
db:
condition: service_healthy
restart: unless-stopped
2022-05-07 14:43:27 +00:00
2022-05-07 14:35:50 +00:00
db:
2022-05-07 15:19:33 +00:00
hostname: mariadb
container_name: mariadb
image: mariadb
2022-05-07 14:35:50 +00:00
environment:
- MYSQL_DATABASE=${MYSQL_DATABASE}
- MYSQL_USER=${MYSQL_USER}
- MYSQL_PASSWORD=${MYSQL_PASSWORD}
- MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
2022-04-21 08:06:30 +00:00
volumes:
2022-05-13 12:26:35 +00:00
- ./mariadb-init:/docker-entrypoint-initdb.d/ # seed volume
2022-05-10 20:22:52 +00:00
- ./mariadb-volume/:/var/lib/mysql/ # data storage
2022-05-07 14:35:50 +00:00
ports:
2022-05-07 15:19:33 +00:00
- "3306:3306"
2022-05-10 20:22:52 +00:00
healthcheck:
test:
[
"CMD-SHELL",
'mysqladmin -p$$MYSQL_ROOT_PASSWORD -h localhost ping | grep "mysqld is alive" || exit 1',
]
interval: 2s
retries: 30
restart: unless-stopped
volumes:
mariadb-volume:
driver: local