forked from tam315/pairwise-pict-online
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.prod.yml
More file actions
29 lines (29 loc) · 887 Bytes
/
docker-compose.prod.yml
File metadata and controls
29 lines (29 loc) · 887 Bytes
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
# use as follows:
# docker-compose -f docker-compose.prod.yml up --build
version: '3.4'
services:
pict_api_prod:
build:
context: ./backend
target: target_for_production
environment:
NODE_ENV: production
container_name: pict_api_prod
ports:
- '8080:8080'
# following frontend will not work because
# browsers doe's not support CORS on localhost.
# CORS should be disabled to test production builds on local environment.
# https://stackoverflow.com/a/10892392/6574720
pict_react_prod:
image: node:12.12.0-alpine
container_name: pict_react_prod
environment:
NODE_ENV: development # run frontend as dev mode to point to the local API
volumes:
- ./frontend:/root/frontend
- /root/frontend/node_modules/
working_dir: /root/frontend
ports:
- '3000:3000'
command: sh -c 'yarn && yarn start'