-
Notifications
You must be signed in to change notification settings - Fork 32
Docker things I noticed trying to run my own dat registry #628
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,28 @@ | ||
FROM node:6.9 | ||
EXPOSE 80 | ||
EXPOSE 25 | ||
|
||
ENV PORT 80 | ||
EXPOSE ${PORT} | ||
|
||
ENV NODE_ENV development | ||
|
||
ENV TOWNSHIP_SECRET "some secret string here" | ||
ENV DATADIR /data | ||
VOLUME /data | ||
VOLUME ${DATADIR} | ||
|
||
RUN mkdir -p /usr/src/app | ||
WORKDIR /usr/src/app | ||
COPY package.json /usr/src/app/ | ||
RUN npm install --production --loglevel warn | ||
RUN npm install --production --loglevel warn | ||
COPY . /usr/src/app | ||
RUN npm run build-js-prod && npm run build-css && npm run minify && npm run version | ||
RUN npm run build-js-prod \ | ||
&& npm run build-css \ | ||
&& npm run minify \ | ||
&& npm run version | ||
|
||
# make it possible to use the image by default | ||
COPY config/default.js config/config.development.js | ||
|
||
# do docker exec: npm run database | ||
|
||
CMD npm run database && DEBUG=dat-registry npm run server | ||
CMD npm run database \ | ||
&& DEBUG=dat-registry npm run server |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
version: '3.4' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you give a tldr on this file or how to use it (maybe add to readme)? Not familiar with docker-swarm. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yup |
||
# start a swarm stack by running | ||
# docker stack up -c docker-swarm.yml dat | ||
# | ||
# Requires a docker swarm with traefik running on an externally connectable `infra_traefik` network | ||
# see https://github.com/onaci/swarm-infra | ||
services: | ||
datbase: | ||
build: . | ||
image: datproject/datbase:${TAG:-master} | ||
environment: | ||
- NODE_ENV=${NODE_ENV} | ||
- TOWNSHIP_SECRET | ||
- DATA=/data | ||
volumes: | ||
- data:/data | ||
configs: | ||
- source: datbase_config | ||
target: /usr/src/app/config/config.development.js | ||
networks: | ||
default: | ||
aliases: | ||
- datbase.${STACKDOMAIN:-loc.alho.st} | ||
infra_traefik: | ||
deploy: | ||
labels: | ||
- "traefik.docker.network=infra_traefik" | ||
# http://datbase.${STACKDOMAIN:-loc.alho.st}/ | ||
- "traefik.datbase.port=80" | ||
- "traefik.datbase.frontend.rule=Host: datbase.${STACKDOMAIN:-loc.alho.st}" | ||
|
||
networks: | ||
infra_traefik: | ||
external: true | ||
|
||
volumes: | ||
data: | ||
|
||
configs: | ||
datbase_config: | ||
file: ./config/default.js |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -55,7 +55,6 @@ | |
"devDependencies": { | ||
"dat-node": "^3.5.0", | ||
"marked": "^0.3.6", | ||
"nodemon": "^1.10.0", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we'd like to keep this in devDependencies b/c its pretty big dependency. Why do you want to move it? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I moved it entirely because the existing Dockerfile and docker image (with the CMD as is) fail to start without it. |
||
"request": "^2.79.0", | ||
"rimraf": "^2.5.4", | ||
"standard": "^7.1.2", | ||
|
@@ -102,6 +101,7 @@ | |
"node-sass": "^3.8.0", | ||
"node-sass-magic-importer": "^0.1.4", | ||
"node-version-assets": "^1.1.0", | ||
"nodemon": "^1.10.0", | ||
"pretty-bytes": "^3.0.1", | ||
"pump": "^1.0.2", | ||
"range-parser": "^1.2.0", | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why 8888 here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah - no good reason I guess