Dockerizing a node.js application
Dockerizing a Node.js Application Welcome back, and great job on migrating the SpaceBones website from NGINX to Apache! President Squawk is very impressed with your skill, and now has another task lined up. As you probably noticed from the current national website, SpaceBones is not only in need of treats, but also in need of a bit of technological advancement. The Radar Board (The official SpaceBones government tech team) has requested your assistance with developing a Node.js web application that can be used for launching a new and improved SpaceBones webspace.
Using the example
Dockerfile included in activity instructions, use Docker to build a new
Node.js app image using the files under the
content-dockerquest-spacebones/nodejs-app subdirectory, named
baconator. Be sure to tag the image as
dev. Good luck!
- Clone the
git clone https://github.com/linuxacademy/content-dockerquest-spacebones
- Move into the
- Use the
Dockerfilebelow to build a new image
FROM node:7 WORKDIR /app COPY package.json /app RUN npm install COPY . /app CMD node index.js EXPOSE 8081
- build container image
docker build -t baconator:dev .
- (optional) Run the image to verify functionality
docker run -d -p 80:8081 baconator:dev