summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLauri Ojansivu <x@xet7.org>2017-01-17 19:18:41 +0200
committerGitHub <noreply@github.com>2017-01-17 19:18:41 +0200
commitc2d2fee2561b1b0dd55120e8368feca263cc1c16 (patch)
tree07a281e342101a33d85ac09ad26a8dfcc1effd27
parentd619921d9c85f7cb30e9022c94b170bc1e571b47 (diff)
parent250650f46af30f1219e77155b76457aa57f5839a (diff)
downloadwekan-c2d2fee2561b1b0dd55120e8368feca263cc1c16.tar.gz
wekan-c2d2fee2561b1b0dd55120e8368feca263cc1c16.tar.bz2
wekan-c2d2fee2561b1b0dd55120e8368feca263cc1c16.zip
Merge pull request #71 from stephenmoloney/devel
locally build docker image
-rw-r--r--Dockerfile76
-rw-r--r--docker-compose.yml74
2 files changed, 116 insertions, 34 deletions
diff --git a/Dockerfile b/Dockerfile
index 591d8ca2..7dea33ed 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,7 +1,71 @@
-FROM meteorhacks/meteord:onbuild
-MAINTAINER Maxime Quandalle <mquandalle@wekan.io>
+FROM debian:wheezy
+MAINTAINER wefork
-# Run as you wish!
-# docker run -d --name wekan-db mongo
-# docker run -d --link "wekan-db:db" -e "MONGO_URL=mongodb://db" \
-# -e "ROOT_URL=http://example.com" -p 8080:80 mquandalle/wekan
+ENV BUILD_DEPS="wget curl bzip2 build-essential python git"
+ARG NODE_VERSION=v0.10.48
+ARG METEOR_RELEASE=1.3.5.1
+ARG NPM_VERSION=3.10.10
+ARG ARCHICTECTURE=linux-x64
+ARG SRC_PATH=./
+
+# Copy the app to the image
+COPY ${SRC_PATH} ./app
+
+# OS dependencies
+RUN apt-get update -y && apt-get install -y ${BUILD_DEPS}
+
+# Download nodejs
+RUN wget https://nodejs.org/dist/${NODE_VERSION}/node-${NODE_VERSION}-${ARCHICTECTURE}.tar.gz && \
+ wget https://nodejs.org/dist/${NODE_VERSION}/SHASUMS256.txt.asc
+
+# Verify nodejs authenticity
+RUN \
+ grep ${NODE_VERSION}-${ARCHICTECTURE}.tar.gz SHASUMS256.txt.asc | shasum -a 256 -c - && \
+ gpg --keyserver pool.sks-keyservers.net --recv-keys 9554F04D7259F04124DE6B476D5A82AC7E37093B && \
+ gpg --keyserver pool.sks-keyservers.net --recv-keys 94AE36675C464D64BAFA68DD7434390BDBE9B9C5 && \
+ gpg --keyserver pool.sks-keyservers.net --recv-keys FD3A5288F042B6850C66B31F09FE44734EB7990E && \
+ gpg --keyserver pool.sks-keyservers.net --recv-keys 71DCFD284A79C3B38668286BC97EC7A07EDE3FC1 && \
+ gpg --keyserver pool.sks-keyservers.net --recv-keys DD8F2338BAE7501E3DD5AC78C273792F7D83545D && \
+ gpg --keyserver pool.sks-keyservers.net --recv-keys C4F0DFFF4E8C1A8236409D08E73BC641CC11F4C8 && \
+ gpg --keyserver pool.sks-keyservers.net --recv-keys B9AE9905FFD7803F25714661B63B535A4C206CA9 && \
+ gpg --refresh-keys pool.sks-keyservers.net && \
+ gpg --verify SHASUMS256.txt.asc
+
+# Install Node
+RUN \
+ tar xvzf node-${NODE_VERSION}-${ARCHICTECTURE}.tar.gz && \
+ rm node-${NODE_VERSION}-${ARCHICTECTURE}.tar.gz && \
+ mv node-${NODE_VERSION}-${ARCHICTECTURE} /opt/nodejs && \
+ ln -s /opt/nodejs/bin/node /usr/bin/node && \
+ ln -s /opt/nodejs/bin/npm /usr/bin/npm
+
+# Install Node dependencies
+RUN npm install npm@${NPM_VERSION} -g && \
+ npm install -g node-gyp && \
+ npm install -g fibers
+
+# Install meteor
+RUN curl https://install.meteor.com -o ./install_meteor.sh && \
+ sed -i "s|RELEASE=.*|RELEASE=${METEOR_RELEASE}\"\"|g" ./install_meteor.sh && \
+ echo "Starting meteor ${METEOR_RELEASE} installation... \n" && \
+ sh ./install_meteor.sh
+
+# Build app
+RUN cd ./app && \
+ meteor npm install --save xss && \
+ echo "Starting meteor build of the app... \n" && \
+ meteor build --directory /opt/app_build && \
+ cd /opt/app_build/bundle/programs/server/ && \
+ npm install && \
+ mv /opt/app_build/bundle /build && \
+ cd /build
+
+# Cleanup
+RUN \
+ apt-get remove --purge -y ${BUILD_DEPS} && \
+ rm -R /var/lib/apt/lists/* /app /opt/app_build ~/.meteor && \
+ rm /install_meteor.sh
+
+ENV PORT=80
+
+CMD ["node", "/build/main.js"]
diff --git a/docker-compose.yml b/docker-compose.yml
index b9f02a48..35318ed0 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -1,31 +1,49 @@
-# You can read the Docker Compose documentation at:
-#
-# https://docs.docker.com/compose/
-#
-# Run with file with `docker-compose up -d`.
-#
-# We use two separate Docker containers: one for the database and one for the
-# Wekan application. The Wekan container doensn’t contain any mutable state
-# (all the user data, even uploads, are saved in the database) so updating it
-# is as simple as stoping the old version and starting the new one. If you want
-# to update the database you need to uncomment the volume section below.
+version: '2'
-wekandb:
- image: mongo
-# volumes:
-# - ./data/runtime/db:/data/db
-# - ./data/dump:/dump
- command: mongod --smallfiles --oplogSize 128
- ports:
- - 27017
+services:
-wekan:
- image: mquandalle/wekan
- links:
- - wekandb
- environment:
- - MONGO_URL=mongodb://wekandb/wekan
- - ROOT_URL=http://localhost:80
- ports:
- - 80:80
+ wekandb:
+ image: mongo:3.4
+ container_name: wekan-db
+ restart: always
+ command: mongod --smallfiles --oplogSize 128
+ networks:
+ - wekan-tier
+ expose:
+ - 27017
+ volumes:
+ - wekan-db:/data/db
+ - wekan-db-dump:/dump
+ wekan:
+ image: wefork/wekan
+ container_name: wekan-app
+ restart: always
+ networks:
+ - wekan-tier
+ build:
+ context: .
+ dockerfile: Dockerfile
+ args:
+ - node_version=${NODE_VERSION}
+ - meteor_release=${METEOR_RELEASE}
+ - npm_version=${NPM_VERSION}
+ - architecture=${ARCHITECTURE}
+ - src_path=${SRC_PATH}
+ ports:
+ - 80:80
+ environment:
+ - MONGO_URL=mongodb://wekandb:27017/wekan
+ - ROOT_URL=http://localhost
+ depends_on:
+ - wekandb
+
+volumes:
+ wekan-db:
+ driver: local
+ wekan-db-dump:
+ driver: local
+
+networks:
+ wekan-tier:
+ driver: bridge