Skip to content

Commit b0a7ac4

Browse files
committed
dev mode setup
1 parent a2228e9 commit b0a7ac4

File tree

4 files changed

+33
-0
lines changed

4 files changed

+33
-0
lines changed

.env-common

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# common environtment variables for dev, prod, review modes

.env-dev

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# specific environtment variables for dev mode

docker-compose.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
version: '3'
2+
3+
services:
4+
5+
dev:
6+
image: ${DOCKER_IMAGE_DEV:-node:8.1.3-alpine}
7+
working_dir: /opt/app
8+
command: sh run-dev.sh
9+
environment:
10+
NODE_ENV: development
11+
PORT: 3000
12+
VIRTUAL_HOST: dev.nodejs.teracy.dev, ~^dev\.nodejs\..*\.xip\.io
13+
VIRTUAL_PORT: 3000
14+
HTTPS_METHOD: noredirect # support both http and https
15+
env_file:
16+
- .env-common
17+
- .env-dev
18+
ports:
19+
- "3000"
20+
- "5858"
21+
volumes:
22+
- .:/opt/app
23+
restart: unless-stopped
24+
# to get this work with https://github.com/jwilder/nginx-proxy
25+
# related: https://github.com/jwilder/nginx-proxy/issues/305
26+
network_mode: bridge

run-dev.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/bash
2+
3+
yarn
4+
5+
yarn run dev

0 commit comments

Comments
 (0)