Created
April 19, 2015 17:56
-
-
Save vjames19/bdd4582905d2a14b90ed to your computer and use it in GitHub Desktop.
nginx, nodejs Docker expample
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM node:0.10-wheezy | |
# node-canvas dependencies. | |
RUN apt-get update && apt-get install -y libcairo2-dev libjpeg8-dev libpango1.0-dev libgif-dev build-essential g++ | |
# nginx (fast proxy server) | |
RUN apt-get update && apt-get install -y nginx | |
# Install global dependencies | |
RUN npm install -g pm2 | |
RUN mkdir -p /home/node/app | |
WORKDIR /home/node/app | |
# Only run npm install if the package.json has changed. | |
COPY package.json /home/node/app/package.json | |
# Install app dependencies | |
RUN npm install --production | |
COPY . . | |
RUN rm -Rf `pwd`/node_modules/cloud | |
RUN ln -s `pwd`/CloudCode/cloud/ ./node_modules/cloud | |
RUN ln -s `pwd`/server/ ./node_modules/cloud/server | |
COPY docker_config/nginx.conf /etc/nginx/nginx.conf | |
# Make the node-app take the following port, so that nginx can listen at port 3000 | |
ENV PORT 3001 | |
# Expose the nginx port. This should match the port in nginx.conf | |
EXPOSE 3000 | |
CMD ["/bin/bash", "./docker_config/start_container.sh"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment