-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
64 lines (60 loc) · 1.91 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
53
54
55
56
57
58
59
60
61
62
63
64
# usage :
#
# ``bash
# # create an external public network
# docker network create traefik-public
# # compose containers
# docker-compose up
# ```
#
# Open swagger ui in Chrome or Vivaldi browser http://web.service.localhost/docs.
# Currently does not work in firefox and safari.
services:
reverse-proxy:
image: traefik:v2.4 # build container from this image
container_name: reverse-proxy
command:
# Traefik will listen on port 8080 by default for API request
- "--api.insecure=true" # NOT RECOMMENDED FOR PRODUCTION
- "--providers.docker"
# do not expose all docker services, only the ones specified
- "--providers.docker.exposedbydefault=false" # don't expose every container to traefik, only enabled ones
- "--entrypoints.http.address=:80"
ports:
# local machine port : container port
- 80:80 # default http ports
- 443:443 # default https ports
- 8080:8080 # default traefik dashboard
restart: always
labels:
- traefik.enable=true
- traefik.docker.network=traefik-public
volumes:
# Add Docker as a mounted volume, so that
# Traefik can communicate w/ it
- /var/run/docker.sock:/var/run/docker.sock
networks:
- traefik-public
# model service
model-service:
image: x86_64/convnet-model-service:0.8.1
container_name: model-service
environment: # set environment variable in container
MODEL_NAME: model
networks:
- traefik-public
# web service
web-service:
image: x86_64/convnet-web-service:0.8.1
container_name: web-service
environment:
SERVING_SERVICE: model-service
labels:
- traefik.enable=true
# specify host to search in web browser
- traefik.http.routers.web-service.rule=Host(`web.service.localhost`)
networks:
- traefik-public
networks:
traefik-public:
external: true