Browse Source

Dockerize: add docker-compose, Dockerfile, .dockerignore and update package.json start script

develop
Chase Sillevis 4 years ago
parent
commit
d4923a4c2b
No known key found for this signature in database GPG Key ID: 427D14BCAA570BF1
6 changed files with 61 additions and 3 deletions
  1. +7
    -0
      .dockerignore
  2. +2
    -1
      .gitignore
  3. +19
    -0
      Dockerfile
  4. +30
    -0
      docker-compose.yml
  5. +2
    -1
      package.json
  6. +1
    -1
      web/vue/UIconfig.js

+ 7
- 0
.dockerignore View File

@ -0,0 +1,7 @@
node_modules
.travis.yml
volumes
config.js
sample-config.js
.git
.gitignore

+ 2
- 1
.gitignore View File

@ -41,4 +41,5 @@ candles.csv
cexio.db
history
TMP_*
.idea
.idea
volumes

+ 19
- 0
Dockerfile View File

@ -0,0 +1,19 @@
FROM node:6.3
# Create app directory
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
# Install app dependencies
COPY package.json /usr/src/app/
RUN npm install --production
RUN npm install redis@0.10.0 talib@1.0.2 pg
# Bundle app source
COPY . /usr/src/app
RUN sed -i 's/127.0.0.1/0.0.0.0/g' web/vue/UIconfig.js
RUN sed -i 's/localhost/0.0.0.0/g' web/vue/UIconfig.js
EXPOSE 3000
CMD [ "npm", "start" ]

+ 30
- 0
docker-compose.yml View File

@ -0,0 +1,30 @@
gekko:
restart: always
build: ./
volumes:
- ./volumes/gekko/history:/usr/src/app/history
- ./config.js:/usr/src/app/config.js
links:
- redis
## optionally set nginx vars if you wish to frontend it with nginx
# environment:
# - VIRTUAL_HOST=gekko
# - PORT=3000
# - DOMAIN=gekko
## if you use nginx vars, comment the below ports
ports:
- "3000:3000"
redis:
image: redis:latest
volumes:
- ./volumes/redis:/data
## optionally uncomment if you wish to use nginx as a frontend
#nginx:
# restart: always
# image: jwilder/nginx-proxy
# ports:
# - "80:80"
# volumes:
# - /var/run/docker.sock:/tmp/docker.sock:ro

+ 2
- 1
package.json View File

@ -10,7 +10,8 @@
"finance"
],
"scripts": {
"test": "./node_modules/.bin/mocha test/*.js --recursive test -u tdd --reporter spec"
"test": "./node_modules/.bin/mocha test/*.js --recursive test -u tdd --reporter spec",
"start": "node ./gekko --config config.js --ui"
},
"author": "Mike van Rossum <mike@mvr.me>",
"dependencies": {

+ 1
- 1
web/vue/UIconfig.js View File

@ -21,4 +21,4 @@ const CONFIG = {
if(typeof window === 'undefined')
module.exports = CONFIG;
else
window.CONFIG = CONFIG;
window.CONFIG = CONFIG;

Loading…
Cancel
Save