Commit 67647f08 authored by Nils Mittler's avatar Nils Mittler 🕵🏼
Browse files

clean up and improve docker related files

parent 7b464fc6
......@@ -6,7 +6,7 @@ FROM node:12
ARG UID_GID=1000:1000
# Set up proper home for node
ENV HOME=/home/node/
ENV HOME=/home/node
WORKDIR $HOME
# Install packages
......@@ -23,8 +23,8 @@ RUN apt-get update && \
RUN npm install -g node-gyp
# Setup mount points with correct permissions
RUN mkdir -p /home/node/locksum /home/node/.meteor /home/node/app/.meteor/local /home/node/app/node_modules
RUN chown -R $UID_GID /home/node
RUN mkdir -p $HOME/locksum $HOME/.meteor $HOME/app/.meteor/local $HOME/app/node_modules
RUN chown -R $UID_GID $HOME
# Set proper user for development
USER $UID_GID
......@@ -32,5 +32,5 @@ USER $UID_GID
RUN curl https://install.meteor.com/ | sh
# Set the proper entrypoint
ENTRYPOINT ["/home/node/app/docker_entrypoint.sh"]
ENTRYPOINT ["/entrypoint.sh"]
CMD ["settings_debug.json"]
......@@ -3,17 +3,17 @@
# Make the meteor executable available
export PATH=$HOME/.meteor:$PATH
cd app
cd $HOME/app
# Install deps if this is first time start or if package-lock has changed
if [[ ! -f /home/node/locksum/locksum ]] || [[ ! $(md5sum /home/node/app/package-lock.json) == $(cat /home/node/locksum/locksum) ]]
if [[ ! -f $HOME/locksum/locksum ]] || [[ ! $(md5sum $HOME/app/package-lock.json) == $(cat $HOME/locksum/locksum) ]]
then
echo "----------------"
echo "This is the first time you starting cards or the package lock has changed."
echo "Going to install npm dependecies..."
echo "----------------"
meteor npm ci
md5sum /home/node/app/package-lock.json > /home/node/locksum/locksum
md5sum $HOME/app/package-lock.json > $HOME/locksum/locksum
fi
/bin/echo -e \
......@@ -32,4 +32,4 @@ depending on your Internet connection.\e[0m\n\
\e[1;32m===================================\e[0m\n\
"
MONGO_URL="mongodb://mongo:27017/meteor" meteor --settings $1
MONGO_URL="mongodb://mongo/meteor" meteor --settings $1
......@@ -8,7 +8,7 @@ arsnova🍅cards uses Meteor as application framework. Download and install [Met
- 4 GB RAM
## Setup with Docker
Instructions for Docker can be found [»here«](docker_readme.md).
Instructions for Docker can be found [»here«](.docker/docker_readme.md).
## Setup (native)
|Step | Linux Terminal Command |
......
......@@ -7,7 +7,7 @@ services:
user: "${UID_GID:-1000:1000}"
build:
context: .
dockerfile: Dockerfile
dockerfile: .docker/develop/Dockerfile
args:
UID_GID: "${UID_GID:-1000:1000}"
volumes:
......@@ -19,6 +19,8 @@ services:
- app_meteor_local:/home/node/app/.meteor/local
# cache lock sum
- locksum:/home/node/locksum
# set entrypoint
- .docker/develop/docker_entrypoint.sh:/entrypoint.sh
ports:
- 3000:3000
depends_on:
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment