-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
152 lines (142 loc) · 3.51 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
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
name: fileshare
services:
database:
image: postgres:alpine
restart: no
volumes:
- app-db-data:/var/lib/postgresql/data/pgdata
ports:
- "5432"
env_file:
- .env
environment:
- PGDATA=/var/lib/postgresql/data/pgdata
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD?Variable not set}
- POSTGRES_USER=${POSTGRES_USER?Variable not set}
- POSTGRES_DB=${POSTGRES_DB?Variable not set}
networks:
- fileshare-public
storage:
image: localstack/localstack:stable
restart: no
volumes:
- app-storage-data:/var/lib/localstack
- ./localstack/cors-config.json:/config/cors-config.json
- ./localstack/init-storage.sh:/etc/localstack/init/ready.d/init-storage.sh
ports:
- "4566:4566"
env_file:
- .env
environment:
- DEBUG=${S3_DEBUG_MODE?Variable not set}
- SERVICES=s3
- FILE_BUCKET_NAME=${S3_FILE_BUCKET_NAME?Variable not set}
# Persistence only available with a pro image
command:
- /bin/bash
- -c
- chmod +x ./localstack/init-storage.sh
networks:
- fileshare-public
cache:
image: redis:alpine
restart: no
volumes:
- cache:/data
ports:
- "6379"
env_file:
- .env
command:
- /bin/sh
- -c
- redis-server --requirepass "$${REDIS_PASSWORD:?REDIS_PASSWORD variable is not set}"
networks:
- fileshare-public
redisinsight:
image: redislabs/redisinsight
ports:
- "5540:5540"
networks:
- fileshare-public
dev-frontend:
profiles: ["dev"]
image: node:latest
working_dir: /app
restart: no
networks:
- fileshare-public
volumes:
- ./frontend:/app
environment:
- WATCHPACK_POLLING=true
- REACT_APP_BACKEND_URL=http://${DOMAIN}:8080
- REACT_APP_STORAGE_URL=http://${DOMAIN}:4566
- REACT_APP_FILE_BUCKET_NAME=${S3_FILE_BUCKET_NAME}
- NODE_ENV=development
ports:
- "3000:3000"
command: npm start
frontend:
restart: no
networks:
- fileshare-public
build:
context: ./frontend
args:
- REACT_APP_BACKEND_URL=http://${DOMAIN}:8080
- REACT_APP_STORAGE_URL=http://${DOMAIN}:4566
- REACT_APP_FILE_BUCKET_NAME=${S3_FILE_BUCKET_NAME}
- NODE_ENV=production
ports:
- "80:80"
depends_on:
- balancer
- storage
balancer:
image: nginx:latest
restart: no
networks:
- fileshare-public
ports:
- "8080:8080"
volumes:
- ./nginx/nginx.conf:/etc/nginx/nginx.conf
depends_on:
- backend
backend:
restart: on-failure:3
depends_on:
- database
- cache
env_file:
- .env
environment:
- DOMAIN=${DOMAIN}
- ENVIRONMENT=${ENVIRONMENT}
- SECRET_KEY=${SECRET_KEY?Variable not set}
- BACKEND_CORS_ORIGINS=${BACKEND_CORS_ORIGINS}
- USERS_OPEN_REGISTRATION=${USERS_OPEN_REGISTRATION}
- POSTGRES_SERVER=database
- POSTGRES_PORT=${POSTGRES_PORT}
- POSTGRES_DB=${POSTGRES_DB}
- POSTGRES_USER=${POSTGRES_USER?Variable not sat}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD?Variable not set}
- REDIS_SERVER=cache
- REDIS_PASSWORD=${REDIS_PASSWORD?Variable not set}
- REDIS_PORT=${REDIS_PORT}
- REDIS_DB=${REDIS_DB}
build:
context: ./backend
ports:
- "8000:8000"
networks:
- fileshare-public
volumes:
app-db-data:
app-storage-data:
cache:
driver: local
networks:
fileshare-public:
driver: bridge