[ BAEL 5508 ] - Mounting Multiple Volumes on a Docker Container (#12589)
* multiple mounts docker compose * exclude localstack files
This commit is contained in:
parent
8ce82953c5
commit
c712729d6a
|
@ -100,3 +100,6 @@ spring-boot-modules/spring-boot-properties-3/*.log
|
||||||
|
|
||||||
# SDKMan
|
# SDKMan
|
||||||
.sdkmanrc
|
.sdkmanrc
|
||||||
|
|
||||||
|
# Localstack
|
||||||
|
**/.localstack
|
|
@ -0,0 +1,15 @@
|
||||||
|
services:
|
||||||
|
mysql-db:
|
||||||
|
image: mysql:latest
|
||||||
|
environment:
|
||||||
|
- MYSQL_ROOT_PASSWORD=password
|
||||||
|
- MYSQL_ROOT_HOST=localhost
|
||||||
|
ports:
|
||||||
|
- '3306:3306'
|
||||||
|
volumes:
|
||||||
|
- first-volume-data:/var/lib/mysql
|
||||||
|
- ./init.sql:/docker-entrypoint-initdb.d/init.sql
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
first-volume-data:
|
||||||
|
external: true
|
|
@ -0,0 +1,9 @@
|
||||||
|
CREATE DATABASE IF NOT EXISTS test;
|
||||||
|
|
||||||
|
use test;
|
||||||
|
|
||||||
|
CREATE TABLE IF NOT EXISTS test_table (id int, description varchar(255));
|
||||||
|
|
||||||
|
INSERT INTO test_table VALUES (1, 'TEST_1');
|
||||||
|
INSERT INTO test_table VALUES (2, 'TEST_2');
|
||||||
|
INSERT INTO test_table VALUES (3, 'TEST_3');
|
|
@ -0,0 +1,15 @@
|
||||||
|
services:
|
||||||
|
localstack:
|
||||||
|
privileged: true
|
||||||
|
image: localstack/localstack:latest
|
||||||
|
container_name: localstack
|
||||||
|
ports:
|
||||||
|
- '4563-4599:4563-4599'
|
||||||
|
- '8055:8080'
|
||||||
|
environment:
|
||||||
|
- SERVICES=s3
|
||||||
|
- DEBUG=1
|
||||||
|
- DATA_DIR=/tmp/localstack/data
|
||||||
|
volumes:
|
||||||
|
- './.localstack:/var/lib/localstack'
|
||||||
|
- '/var/run/docker.sock:/var/run/docker.sock'
|
|
@ -0,0 +1,15 @@
|
||||||
|
services:
|
||||||
|
my_app:
|
||||||
|
image: web-app:latest
|
||||||
|
container_name: web-app
|
||||||
|
ports:
|
||||||
|
- "8080:8080"
|
||||||
|
volumes:
|
||||||
|
- first-volume-data:/container-path-1
|
||||||
|
- second-volume-data:/container-path-2:ro
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
first-volume-data:
|
||||||
|
driver: local
|
||||||
|
second-volume-data:
|
||||||
|
driver: local
|
Loading…
Reference in New Issue