forked from Ocelot-Social-Community/Ocelot-Social
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
162 lines (154 loc) · 5.57 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
153
154
155
156
157
158
159
160
161
162
# This file defines the production settings. It is overwritten by docker-compose.override.yml,
# which defines the development settings. The override.yml is loaded by default. Therefore it
# is required to explicitly define if you want an production build:
# > docker-compose -f docker-compose.yml up
services:
########################################################
# WEBAPP ###############################################
########################################################
webapp:
# name the image so that it cannot be found in a DockerHub repository, otherwise it will not be built locally from the 'dockerfile' but pulled from there
image: ocelotsocialnetwork/webapp:local-production
container_name: webapp
build:
context: ./webapp
target: production
networks:
- external-net
depends_on:
- backend
ports:
- 3000:3000
# Storybook: Todo externalize, its not working anyways
# - 3002:3002
environment:
# Envs used in Dockerfile
# - DOCKER_WORKDIR="/app"
# - PORT="3000"
- BUILD_DATE
- BUILD_VERSION
- BUILD_COMMIT
- NODE_ENV="production"
# Application only envs
- HOST=0.0.0.0 # This is nuxt specific, alternative value is HOST=webapp
- GRAPHQL_URI=http://backend:4000
env_file:
- ./webapp/.env
########################################################
# FRONTEND #############################################
########################################################
frontend:
# name the image so that it cannot be found in a DockerHub repository, otherwise it will not be built locally from the 'dockerfile' but pulled from there
image: ocelotsocialnetwork/frontend:local-production
container_name: frontend
build:
context: ./frontend
target: production
networks:
- external-net
depends_on:
- backend
ports:
- 3002:3002
environment:
# Envs used in Dockerfile
# - DOCKER_WORKDIR="/app"
# - PORT="3002"
- BUILD_DATE
- BUILD_VERSION
- BUILD_COMMIT
- NODE_ENV="production"
# Application only envs
#- HOST=0.0.0.0 # This is nuxt specific, alternative value is HOST=webapp
#- GRAPHQL_URI=http://backend:4000
env_file:
- ./frontend/.env
########################################################
# BACKEND ##############################################
########################################################
backend:
# name the image so that it cannot be found in a DockerHub repository, otherwise it will not be built locally from the 'dockerfile' but pulled from there
image: ocelotsocialnetwork/backend:local-production
container_name: backend
build:
context: ./backend
target: production
networks:
- external-net
- internal-net
depends_on:
- neo4j
ports:
- 4000:4000
volumes:
- backend_uploads:/app/public/uploads
environment:
# Envs used in Dockerfile
# - DOCKER_WORKDIR="/app"
# - PORT="4000"
- BUILD_DATE
- BUILD_VERSION
- BUILD_COMMIT
- NODE_ENV="production"
# Application only envs
- DEBUG=false
- NEO4J_URI=bolt://neo4j:7687
- GRAPHQL_URI=http://backend:4000
- CLIENT_URI=http://webapp:3000
env_file:
- ./backend/.env
########################################################
# MAINTENANCE ##########################################
########################################################
maintenance:
# name the image so that it cannot be found in a DockerHub repository, otherwise it will not be built locally from the 'dockerfile' but pulled from there
image: ocelotsocialnetwork/maintenance:local-production
container_name: maintenance
build:
# TODO: Separate from webapp, this must be independent
context: ./webapp
dockerfile: Dockerfile.maintenance
networks:
- external-net
ports:
- 3001:80
########################################################
# NEO4J ################################################
########################################################
neo4j:
# name the image so that it cannot be found in a DockerHub repository, otherwise it will not be built locally from the 'dockerfile' but pulled from there
image: ocelotsocialnetwork/neo4j-community:local-production
container_name: neo4j
build:
context: ./neo4j
# community edition 👆🏼, because we have no enterprise licence 👇🏼 at the moment
target: community
networks:
- internal-net
ports:
- 7687:7687
volumes:
- neo4j_data:/data
environment:
# settings reference: https://neo4j.com/docs/operations-manual/4.4/docker/ref-settings/
# TODO: This sounds scary for a production environment
- NEO4J_AUTH=none
- NEO4J_dbms_security_procedures_unrestricted=algo.*,apoc.*
- NEO4J_dbms_allow__format__migration=true
- NEO4J_dbms_allow__upgrade=true
# uncomment following line for Neo4j Enterprise version instead of Community version
# TODO: clarify if that is the only thing needed to unlock the Enterprise version
# - NEO4J_ACCEPT_LICENSE_AGREEMENT=yes
# set the name of the database to be used
# - NEO4J_dbms_default__database=graph.db
# - NEO4J_dbms_default__database=neo4j
# TODO: Remove the playground from production
# bring the database in offline mode to export or load dumps
# command: ["tail", "-f", "/dev/null"]
networks:
external-net:
internal-net:
internal: true
volumes:
backend_uploads:
neo4j_data: