Initial commit
This commit is contained in:
21
Dockerfile
Normal file
21
Dockerfile
Normal file
@@ -0,0 +1,21 @@
|
||||
FROM node AS dev
|
||||
|
||||
# define /app as working directory
|
||||
WORKDIR /app
|
||||
|
||||
# copy package.json and package-lock.json to /app
|
||||
COPY package.json /app
|
||||
COPY package-lock.json /app
|
||||
|
||||
# install node dependencies
|
||||
RUN npm install
|
||||
COPY . /app
|
||||
|
||||
# launch node server
|
||||
ENTRYPOINT npm run dev
|
||||
|
||||
# production
|
||||
# we will not use npm in production as it wants to write on the container filesystem. this should be prohibited on production. however, we need to allow it while developing.
|
||||
FROM dev AS prod
|
||||
RUN npm install --production
|
||||
ENTRYPOINT node app.js
|
Reference in New Issue
Block a user