-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.yaml
46 lines (40 loc) · 1.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
# Docker Compose file for the URLshortening-distributed-system
version: "3.8"
services:
# Cache service
memcached:
container_name: memcachedcontainer
image: memcached:latest
ports:
- "11211:11211" # Mapping port 11211 of the host to port 11211 of the container
networks:
- mynetwork
# Server service
server:
container_name: servercontainer
build:
context: ./server # Path to the directory containing the Dockerfile
dockerfile: Dockerfile # Name of the Dockerfile
ports:
- "8000:8000" # Mapping port 8000 of the host to port 8000 of the container
env_file:
- ./server/.env # Map container port to host port
depends_on:
- memcached # Ensure memcached service is started before the client
networks:
- mynetwork
# Client service
client:
container_name: clientcontainer
build:
context: ./client # Path to the directory containing the Dockerfile
dockerfile: Dockerfile # Name of the Dockerfile
ports:
- "3000:3000" # Mapping port 3000 of the host to port 3000 of the container
depends_on:
- server # Ensure server service is started before the client
networks:
- mynetwork
networks:
mynetwork:
driver: bridge