Commit bb02ec2a authored by priit's avatar priit

Dockeri alge

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