Skip to content

Commit 8f790f3

Browse files
committed
Provide a staging docker-compose.yml for WebApp
1 parent 1c9efde commit 8f790f3

5 files changed

Lines changed: 86 additions & 10 deletions

File tree

.dockerignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,6 @@ node_modules/
55
build/
66
npm-debug.log
77
Dockerfile
8-
.env
8+
docker-compose*.yml
99
.env-secrets
10+
.env

Dockerfile

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ EXPOSE 3000
77
# optional git commit hash
88
ARG BUILD_COMMIT
99
ENV BUILD_COMMIT=$BUILD_COMMIT
10+
ENV NODE_ENV=production
1011

1112
RUN mkdir -p /WebApp/
1213
WORKDIR /WebApp/
@@ -18,12 +19,9 @@ RUN yarn global add pm2
1819

1920
COPY package.json /WebApp/
2021
COPY yarn.lock /WebApp/
21-
RUN yarn install --frozen-lockfile --non-interactive
22+
RUN yarn install --production=false --frozen-lockfile --non-interactive
2223

2324
RUN apk del build-dependencies
2425

25-
# must be after `yarn install`
26-
ENV NODE_ENV=production
27-
2826
COPY . /WebApp/
29-
CMD ["pm2", "start", "node", "build/main.js", "-n", "frontend", "-i", "2", "--attach"]
27+
CMD ["yarn", "run", "deploy"]

docker-compose.override.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
version: '3'
2+
3+
services:
4+
webapp:
5+
command: yarn run dev
6+
volumes:
7+
- .:/WebApp
8+
- /WebApp/node_modules/

docker-compose.staging.yml

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
version: '3'
2+
3+
services:
4+
webapp:
5+
image: humanconnection/frontend-nuxt
6+
networks:
7+
hc-network:
8+
ipv4_address: 172.25.0.20
9+
environment:
10+
- NODE_ENV=staging
11+
- WEBAPP_HOST=172.25.0.20
12+
- WEBAPP_BASE_URL=http://172.25.0.20:3000
13+
- API_HOST=172.25.0.11
14+
- WEBAPP_PORT=3000
15+
- API_PORT=3030
16+
- MAPBOX_TOKEN=pk.eyJ1IjoiaHVtYW4tY29ubmVjdGlvbiIsImEiOiJjajl0cnBubGoweTVlM3VwZ2lzNTNud3ZtIn0.KZ8KK9l70omjXbEkkbHGsQ
17+
- SENTRY_DNS_PUBLIC=
18+
- EMBED_API_URL=
19+
# these secrets should only be accessible on the server:
20+
- SENTRY_DNS_PRIVATE=
21+
- EMBED_API_TOKEN=
22+
depends_on:
23+
- api
24+
build:
25+
args:
26+
BUILD_COMMIT: ${BUILD_COMMIT}
27+
mongo:
28+
image: mongo
29+
networks:
30+
- hc-network
31+
command: "--smallfiles --logpath=/dev/null"
32+
api:
33+
image: humanconnection/api-feathers
34+
depends_on:
35+
- maildev
36+
- thumbor
37+
- mongo
38+
environment:
39+
- NODE_ENV=staging
40+
ports:
41+
- "3030:3030"
42+
stdin_open: true
43+
tty: true
44+
networks:
45+
hc-network:
46+
ipv4_address: 172.25.0.11
47+
thumbor:
48+
networks:
49+
- hc-network
50+
maildev:
51+
image: djfarrelly/maildev
52+
networks:
53+
- hc-network
54+
ports:
55+
- "1080:80"
56+
- "1025:25"
57+
thumbor:
58+
image: apsl/thumbor
59+
networks:
60+
- hc-network
61+
ports:
62+
- "8000:8000"
63+
64+
networks:
65+
hc-network:
66+
driver: bridge
67+
ipam:
68+
driver: default
69+
config:
70+
-
71+
subnet: 172.25.0.0/16

docker-compose.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@ services:
77
context: .
88
args:
99
BUILD_COMMIT: ${BUILD_COMMIT}
10+
stdin_open: true
11+
tty: true
1012
ports:
1113
- 3000:3000/tcp
12-
command: yarn run dev
13-
volumes:
14-
- .:/WebApp
15-
- /WebApp/node_modules/

0 commit comments

Comments
 (0)