-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
52 lines (51 loc) · 1.49 KB
/
docker-compose.yml
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
# Define services
services:
postgres:
container_name: postgres
image: "postgres:12"
environment:
POSTGRES_USER: "postgres"
POSTGRES_PASSWORD: "1234"
POSTGRES_DB: "hotel_reservation"
POSTGRES_HOST: "127.0.0.1"
PGDATA: "/data/postgres"
expose:
- 5432
volumes:
- postgres:/data/postgres
- ./docker_postgres_init.sql:/docker-entrypoint-initdb.d/docker_postgres_init.sql
ports:
- "5432:5432"
restart: unless-stopped
networks:
- backend
rabbitmq:
image: rabbitmq:3.8-management-alpine
container_name: 'rabbitmq'
ports:
- 5673:5672
- 15673:15672
volumes:
- ~/.docker-conf/rabbitmq/data/:/var/lib/rabbitmq/
- ~/.docker-conf/rabbitmq/log/:/var/log/rabbitmq
networks:
- backend
# App Service
app:
# Configuration for building the docker image for the service
build:
context: . # Use an image built from the specified dockerfile in the current directory.
dockerfile: Dockerfile
ports:
- "8080:8080" # Forward the exposed port 8080 on the container to port 8080 on the host machine
restart: unless-stopped
depends_on:
- postgres # This service depends on redis. Start that first.
environment: # Pass environment variables to the service
REDIS_URL: redis:6379
networks: # Networks to join (Services on the same network can communicate with each other using their name)
- backend
networks:
backend:
volumes:
postgres: