Skip to content
Snippets Groups Projects
Commit 84bbc4e2 authored by Burhan Akbar's avatar Burhan Akbar
Browse files

Switch to host networking to avoid Docker bridge crash

parent a5d93259
No related branches found
No related tags found
No related merge requests found
File moved
...@@ -4,8 +4,8 @@ services: ...@@ -4,8 +4,8 @@ services:
mariadb: mariadb:
image: mariadb:10.11.11 image: mariadb:10.11.11
container_name: mariadb container_name: mariadb
ports: # Host networking means this container listens on the host’s 3306
- "3306:3306" network_mode: "host"
environment: environment:
MYSQL_ROOT_PASSWORD: comsc MYSQL_ROOT_PASSWORD: comsc
MYSQL_DATABASE: healthcare MYSQL_DATABASE: healthcare
...@@ -16,31 +16,23 @@ services: ...@@ -16,31 +16,23 @@ services:
limits: limits:
cpus: '1' cpus: '1'
memory: 1024M memory: 1024M
networks:
- healthcare_network
healthcare_01: healthcare_01:
build: build:
context: . context: .
dockerfile: Docker/Dockerfile dockerfile: Docker/Dockerfile
container_name: healthcare_01 container_name: healthcare_01
# Shares the host network, so no port mapping is needed
network_mode: "host"
environment: environment:
- DB_URL=jdbc:mariadb://mariadb:3306/healthcare?createDatabaseIfNotExist=true - DB_URL=jdbc:mariadb://localhost:3306/healthcare?createDatabaseIfNotExist=true
- SPRING_DATASOURCE_URL=jdbc:mariadb://mariadb:3306/healthcare?createDatabaseIfNotExist=true - SPRING_DATASOURCE_URL=jdbc:mariadb://localhost:3306/healthcare?createDatabaseIfNotExist=true
- SPRING_DATASOURCE_USERNAME=root - SPRING_DATASOURCE_USERNAME=root
- SPRING_DATASOURCE_PASSWORD=comsc - SPRING_DATASOURCE_PASSWORD=comsc
ports:
- "8080:8080"
deploy: deploy:
resources: resources:
limits: limits:
cpus: '1' cpus: '1'
memory: 1536M memory: 1536M
networks:
- healthcare_network
depends_on: depends_on:
- mariadb - mariadb
networks:
healthcare_network:
name: healthcare_net
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment