-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yaml
73 lines (69 loc) · 2.24 KB
/
docker-compose.yaml
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
version: '3.7'
# Define services
services:
# App backend service
api:
# Configuration for building the docker image for the backend service
build:
context: ../ultrasound-app
dockerfile: Dockerfile
ports:
- ${API_CONTAINER_PORT}:8080 # Forward the exposed port 8080 on the container to port 8080 on the host machine
restart: always
# depends_on:
# - db # This service depends on mysql. Start that first.
environment: # Pass environment variables to the service
SPRING_PROFILES_ACTIVE: ${SPRING_ACTIVE_PROFILE}
networks: # Networks to join (Services on the same network can communicate with each other using their name)
- backend
- frontend
# Frontend Service
client:
build:
context: ../ultrasound-client # Use an image built from the specified
dockerfile: ../ultrasound-client/Dockerfile
args:
REACT_APP_API_BASE_URL: http://localhost:${API_CONTAINER_PORT}/api/
ports:
- ${CLIENT_CONTAINER_PORT}:6088 # Map the exposed port 80 on the container to port 9090 on the host machine
restart: always
depends_on:
- api
networks:
- frontend
#
# mongodb:
# image: mongo
# container_name: mongodb
# ports:
# - "27017:27017"
# volumes:
# - db-data:/data
# environment:
# - MONGO_INITDB_ROOT_USERNAME=rootuser
# - MONGO_INITDB_ROOT_PASSWORD=rootpass
# mongo-express:
# image: mongo-express
# container_name: mongo-express
# restart: always
# ports:
# - 8081:8081
# environment:
# - ME_CONFIG_MONGODB_ADMINUSERNAME=rootuser
# - ME_CONFIG_MONGODB_ADMINPASSWORD=rootpass
# - ME_CONFIG_MONGODB_SERVER=mongodb
# Volumes
volumes:
db-data:
# Networks to be created to facilitate communication between containers
networks:
backend:
frontend:
# HEROKU DEPLOYMENT:
# - To build jar file run:
# docker-compose pull
# docker compose --env-file .env.qa up --force-recreate --build -d
# - To look at logs from QA
# docker logs ultrasound-app_api_1 --follow
# - To push to heroku run:
# heroku container:push web --app ultrasound-fellowship-app