forked from devopscorner/k8s-context
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
75 lines (71 loc) · 2.59 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
65
66
67
68
69
70
71
72
73
74
75
version: '3.7'
#================================================================================================
# NETWORK SETUP
#================================================================================================
networks:
devopscorner_net:
name: devopscorner_net
driver: bridge
ipam:
config:
- subnet: 172.148.0.0/16
#================================================================================================
# VOLUME SETUP
#================================================================================================
volumes:
vol_portainer:
driver: ${VOLUMES_DRIVER:-local}
driver_opts:
o: bind
type: none
device: ${DATA_PORTAINER:-/opt/data/docker/portainer2.9}
vol_k8s_context:
driver: ${VOLUMES_DRIVER:-local}
driver_opts:
o: bind
type: none
device: ${DATA_K8S_CONTEXT:-/opt/data/docker/k8s-context}
services:
#================================================================================================
# PORTAINER
#================================================================================================
portainer:
image: dockerframework/portainer:${PORTAINER_VERSION:-2.9}
container_name: ${CONTAINER_PORTAINER:-devopscorner_portainer}
restart: unless-stopped
ports:
- "${PORT_PORTAINER:-5212}:9000"
volumes:
# - /etc/localtime:/etc/localtime:ro ## Do not use it in mac
- /var/run/docker.sock:/var/run/docker.sock ## Do not use it in k8s
- vol_portainer:/data
environment:
- PORTAINER_TEMPLATE=generic
- PORTAINER_VERSION=${PORTAINER_VERSION:-2.9}
privileged: true
networks:
devopscorner_net:
ipv4_address: ${CONTAINER_IP_PORTAINER:-172.148.148.5}
#================================================================================================
# GOLANG-BOOKSTORE
#================================================================================================
k8s-context:
build:
context: .
dockerfile: Dockerfile
# image: devopscorner/k8s-context:alpine
container_name: ${CONTAINER_K8S_CONTEXT:-devopscorner_k8s_context}
restart: unless-stopped
ports:
- "${PORT_K8S_CONTEXT:-8080}:80"
volumes:
# - /etc/localtime:/etc/localtime:ro ## Do not use it in mac
- /var/run/docker.sock:/var/run/docker.sock ## Do not use it in k8s
environment:
- TZ="Asia/Jakarta"
- ALPINE_VERSION=${ALPINE_VERSION:-3.16}
privileged: true
tty: true
networks:
devopscorner_net:
ipv4_address: ${CONTAINER_IP_K8S_CONTEXT:-172.148.148.227}