Skip to content

Commit

Permalink
feat: dev docker-compose
Browse files Browse the repository at this point in the history
  • Loading branch information
NGPixel committed Aug 28, 2018
1 parent 4cb9f3d commit 2483dce
Show file tree
Hide file tree
Showing 6 changed files with 95 additions and 6 deletions.
19 changes: 13 additions & 6 deletions dev/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
FROM requarks/wiki:latest
# -- DEV DOCKERFILE --
# -- DO NOT USE IN PRODUCTION! --

# Replace with your email address:
ENV WIKI_ADMIN_EMAIL [email protected]
FROM node:8-alpine
LABEL maintainer "requarks.io"

RUN apk update && \
apk add bash curl git python make g++ --no-cache && \
mkdir -p /var/wiki

WORKDIR /var/wiki
COPY package.json .
RUN yarn --silent

# Replace your-config.yml with the path to your config file:
ADD your-config.yml config.yml
ENV dockerdev 1

EXPOSE 3000
ENTRYPOINT [ "node", "server" ]

CMD ["tail", "-f", "/dev/null"]
16 changes: 16 additions & 0 deletions dev/docker/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
port: 3000
paths:
content: ./content
data: ./data
db:
type: postgres
host: db
port: 5432
user: wikijs
pass: wikijsrocks
db: wiki
redis:
host: redis
port: 6379
db: 0
logLevel: info
12 changes: 12 additions & 0 deletions dev/examples/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM requarks/wiki:latest

# Replace with your email address:
ENV WIKI_ADMIN_EMAIL [email protected]

WORKDIR /var/wiki

# Replace your-config.yml with the path to your config file:
ADD your-config.yml config.yml

EXPOSE 3000
ENTRYPOINT [ "node", "server" ]
File renamed without changes.
50 changes: 50 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# -- DEV DOCKER-COMPOSE --
# -- DO NOT USE IN PRODUCTION! --

version: "3"
services:

redis:
image: redis:4-alpine
ports:
- "16379:6379"
logging:
driver: "none"
networks:
- wikinet

db:
image: postgres:9-alpine
environment:
POSTGRES_DB: wiki
POSTGRES_PASSWORD: wikijsrocks
POSTGRES_USER: wikijs
logging:
driver: "none"
volumes:
- db-data:/var/lib/postgresql/data
networks:
- wikinet
ports:
- "15432:5432"

wiki:
build:
context: .
dockerfile: dev/docker/Dockerfile
depends_on:
- db
- redis
networks:
- wikinet
ports:
- "3000:3000"
volumes:
- .:/var/wiki
- /var/wiki/node_modules

networks:
wikinet:

volumes:
db-data:
4 changes: 4 additions & 0 deletions server/core/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ module.exports = {
dataRegex: path.join(WIKI.SERVERPATH, 'app/regex.js')
}

if (process.env.dockerdev) {
confPaths.config = path.join(WIKI.ROOTPATH, 'dev/docker/config.yml')
}

process.stdout.write(chalk.blue(`Loading configuration from ${confPaths.config}... `))

let appconfig = {}
Expand Down

0 comments on commit 2483dce

Please sign in to comment.