Skip to content

Instantly share code, notes, and snippets.

@vjames19
Created April 19, 2015 17:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vjames19/bdd4582905d2a14b90ed to your computer and use it in GitHub Desktop.
Save vjames19/bdd4582905d2a14b90ed to your computer and use it in GitHub Desktop.
nginx, nodejs Docker expample
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