Skip to content

Commit

Permalink
Docker: further improve
Browse files Browse the repository at this point in the history
  • Loading branch information
DeviaVir committed May 16, 2017
1 parent d4923a4 commit e2ff664
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 13 deletions.
2 changes: 2 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
HOST=localhost
PORT=3000
11 changes: 6 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
FROM node:6.3

ENV HOST localhost
ENV PORT 3000

# Create app directory
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
Expand All @@ -11,9 +14,7 @@ RUN npm install [email protected] [email protected] 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
RUN chmod +x /usr/src/app/docker-entrypoint.sh

CMD [ "npm", "start" ]
ENTRYPOINT ["/usr/src/app/docker-entrypoint.sh"]
CMD [ "npm", "start" ]
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,23 @@ See [the documentation website](https://gekko.wizb.it/docs/introduction/about_ge

See [the installing Gekko doc](https://gekko.wizb.it/docs/installation/installing_gekko.html).

## Docker

We provide a docker-compose that you can use out of the box:

```
$ docker-compose build
$ HOST=mydomain.com PORT=3001 docker-compose up -d
```

You can now find your gekko instance running on mydomain.com:3001.
By default these are set to:

```
HOST=localhost
PORT=3000
```

## Final

If Gekko helped you in any way, you can always leave me a tip at (BTC) 13r1jyivitShUiv9FJvjLH7Nh1ZZptumwW
13 changes: 5 additions & 8 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,11 @@ gekko:
- ./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"
environment:
- HOST
- PORT
ports: # you can comment this out when using the nginx frontend
- "${PORT}:${PORT}"

redis:
image: redis:latest
Expand Down
6 changes: 6 additions & 0 deletions docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash

sed -i 's/127.0.0.1/0.0.0.0/g' /usr/src/app/web/vue/UIconfig.js
sed -i 's/localhost/'${HOST}'/g' /usr/src/app/web/vue/UIconfig.js
sed -i 's/3000/'${PORT}'/g' /usr/src/app/web/vue/UIconfig.js
exec "$@"

0 comments on commit e2ff664

Please sign in to comment.