library icon indicating copy to clipboard operation
library copied to clipboard

Improvement to Dockerfile

Open thomasoide opened this issue 5 years ago • 0 comments

Problem Description

I had quite the time trying to get this deployed using Docker/ECR/ECS. I couldn't get it deployed using the nytimes/library image, but I did get something deployed when I forked the repo and used the included Dockerfile.

Feature

This is the current Dockerfile:

FROM node:10

RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app

# Install NPMs
COPY package.json* package-lock.json* /usr/src/app/
RUN npm i --production

COPY . /usr/src/app
RUN npm run build

This Dockerfile successfully builds the image, but never actually runs the start command before putting it in a ECS cluster.

Adding CMD ["npm", "run", "start] after running the build made the app work for me.

Since it's only one line, I figured it's not worth a pull request, especially since I've made other changes to my fork. Thought it would be worth giving you guys the heads up.

Additional Information

Once I finalize the details for our deployment, would there be interest in adding additional documentation on deploying with Docker? I'd be happy to write that if you feel it's necessary.

thomasoide avatar Oct 25 '19 18:10 thomasoide