Commit bb02ec2a authored by priit's avatar priit

Dockeri alge

parent c8f0cc64
# docker build -t kl_wrapper .
# docker run --name kl_redis --rm --restart=no redis
# docker run --name kl_wrapper -d --link kl_redis:redis -p 3000:3000 -v /wrapper/concat:/src kl_wrapper
# docker run --name kl_wrapper -d --link kl_redis:redis -p 3000:3000 -v /wrapper/concat/:/config kl_wrapper
# docker kill kl_wrapper
# docker rm kl_wrapper
#
......@@ -15,13 +15,17 @@ RUN apt-get update && \
RUN npm install -g forever
RUN mkdir -p /src
RUN cd /src && git clone 'https://github.com/BitWeb/keeleliin-wrapper-service.git' . && echo "Git is cloned 2"
RUN cd /src && npm install && echo "NPM is installed 1"
RUN mkdir -p /src && mkdir -p /config && \
cd /src && \
git clone 'https://github.com/BitWeb/keeleliin-wrapper-service.git' . && \
npm install && \
pwd && \
ls -la && \
echo "NPM is installed 1"
#Expose port
EXPOSE 3000
VOLUME ["/src"]
VOLUME ["/config"]
CMD /./src/docker_start.sh
\ No newline at end of file
#!/bin/bash
cp -R -u -p /src/config_dist.js /config/config.js
if [ -f /config/config.js ]; then
cp /config/config.js /src/config.js
fi
if [ ! -f /src/config.js ]; then
cp -R -u -p /src/config_dist.js /src/config.js
fi
......
......@@ -4,6 +4,10 @@ cd /src
git pull
npm install
if [ -f /config/config.js ]; then
cp /config/config.js /src/config.js
fi
forever stopall
forever /src/app.js
forever list
\ No newline at end of file
Markdown is supported
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