-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathraspi.yml
153 lines (143 loc) · 3.9 KB
/
raspi.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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
# deploy locally on raspberry pi with single node swarm cluster
version: "3.4"
services:
postgres:
image: postgres:13.1
networks:
- main
env_file:
- .env
volumes:
- pgdata:/var/lib/postgresql/data
redis:
image: redis:alpine
volumes:
- redisdata:/data
networks:
- main
# traefik:
# image: traefik:v2.3.2
# ports:
# - "80:80"
# - "443:443"
# command:
# - "--providers.docker.endpoint=unix:///var/run/docker.sock"
# - "--providers.docker.swarmMode=true"
# - "--providers.docker.exposedbydefault=false"
# - "--providers.docker.network=traefik-public"
# - "--entrypoints.web.address=:80"
# - "--entrypoints.websecure.address=:443"
# - "--certificatesresolvers.letsencryptresolver.acme.httpchallenge=true"
# - "--certificatesresolvers.letsencryptresolver.acme.httpchallenge.entrypoint=web"
# - "--certificatesresolvers.letsencryptresolver.acme.email=brian@briancaffey.com"
# - "--certificatesresolvers.letsencryptresolver.acme.storage=/letsencrypt/acme.json"
# volumes:
# - letsencrypt:/letsencrypt
# - /var/run/docker.sock:/var/run/docker.sock
# networks:
# - traefik-public
# deploy:
# placement:
# constraints:
# - node.role == manager
# labels:
# - "traefik.enable=true"
# - "traefik.http.routers.http-catchall.rule=hostregexp(`{host:.+}`)"
# - "traefik.http.routers.http-catchall.entrypoints=web,websecure"
# - "traefik.http.routers.http-catchall.middlewares=redirect-to-https@docker"
# - "traefik.http.routers.http-catchall.service=redirect-service"
# - "traefik.http.services.redirect-service.loadbalancer.server.port=80"
# - "traefik.http.middlewares.redirect-to-https.redirectscheme.scheme=https"
backend:
image: ${CI_REGISTRY_IMAGE}/backend:${CI_COMMIT_SHORT_SHA}
networks:
- main
command:
- "gunicorn"
- "-t"
- "1000"
- "-b"
- "0.0.0.0:8000"
- "--log-level"
- "error"
- "backend.wsgi"
ports:
- "8000:8000"
# environment:
# - DJANGO_SETTINGS_MODULE=backend.settings.production
# - POSTGRES_PASSWORD
# - SECRET_KEY
# - DEBUG
# - DOMAIN_NAME
# - DJANGO_SUPERUSER_EMAIL
# - DJANGO_SUPERUSER_PASSWORD
# - DJANGO_SUPERUSER_USERNAME
env_file:
- .env
volumes:
- backendassets:/code/assets
depends_on:
- postgres
- redis
celery:
image: ${CI_REGISTRY_IMAGE}/backend:${CI_COMMIT_SHORT_SHA}
command:
- "celery"
- "--app=backend.celery_app:app"
- "worker"
- "-Q"
- "default"
- "--concurrency=1"
- "--loglevel=INFO"
networks:
- main
env_file:
- .env
volumes:
- backendassets:/code/assets
depends_on:
- postgres
- redis
flower:
image: mher/flower:latest
container_name: flower
environment:
- CELERY_BROKER_URL=redis://redis:6379/1
- FLOWER_PORT=5555
ports:
- 5555:5555
networks:
- main
depends_on:
- celery
- redis
web:
image: ${CI_REGISTRY_IMAGE}/nginx:${CI_COMMIT_SHORT_SHA}
networks:
# - traefik-public
- main
ports:
- "80:80"
volumes:
- backendassets:/usr/src/app/assets
# deploy:
# labels:
# - "traefik.enable=true"
# - "traefik.http.routers.nginx-web.rule=Host(`${DOMAIN_NAME}`)"
# - "traefik.http.routers.nginx-web.entrypoints=websecure"
# - "traefik.http.routers.nginx-web.tls.certresolver=letsencryptresolver"
# - "traefik.http.services.nginx-web.loadbalancer.server.port=80"
networks:
# traefik-public:
# external: true
main:
driver: overlay
volumes:
# letsencrypt:
# name: letsencrypt
backendassets:
name: backendassets
redisdata:
name: redisdata
pgdata:
name: pgdata