Skip to content
This repository was archived by the owner on Jun 27, 2019. It is now read-only.

Commit 9f2e9a5

Browse files
committed
Replace copy of config files for docker at runtime
Reason: I might want to set database cleaner configs withouth rebuilding the docker container. So, syncing the config/ folder would be desired. But then we don't want the configuration for the host system to get in conflict with the docker settings. Solution: Set node instance environment variable to `docker`.
1 parent 2d31149 commit 9f2e9a5

File tree

6 files changed

+7
-22
lines changed

6 files changed

+7
-22
lines changed

Dockerfile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ EXPOSE 3030
66
# chrome debugging
77
EXPOSE 9229
88

9+
# override configuration by instance name in docker container
10+
ENV NODE_APP_INSTANCE=docker
11+
912
# update unix packages
1013
RUN apk update && apk upgrade
1114
RUN rm -rf /var/cache/apk/*
@@ -22,8 +25,6 @@ RUN yarn install --frozen-lockfile --non-interactive
2225

2326
# copy the code to the docker image
2427
COPY . /API
25-
# setup local configuration
26-
COPY ./config/docker/* /API/config/
2728

2829
# start the application in a autohealing cluster
2930
# NOTE: quick fix for server issues, restart api when reaching max of 300 MB Memory Usage (happens in conjunction with 100% CPU Usage)

config/default-docker.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"mongodb": "mongodb://mongo:27017/hc_api",
3+
"host": "0.0.0.0"
4+
}

config/docker/local-development.json

Lines changed: 0 additions & 7 deletions
This file was deleted.

config/docker/local.json

Lines changed: 0 additions & 8 deletions
This file was deleted.
File renamed without changes.

docker-compose.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,9 @@ services:
99
links:
1010
- mongo
1111
- maildev
12-
environment:
13-
- NODE_ENV=development
1412
command: yarn run dev
1513
volumes:
1614
- .:/API
17-
- docker_config:/API/config
1815
mongo:
1916
image: mongo
2017
command: "--smallfiles --logpath=/dev/null"
@@ -23,5 +20,3 @@ services:
2320
ports:
2421
- "1080:80"
2522
- "1025:25"
26-
volumes:
27-
docker_config:

0 commit comments

Comments
 (0)