api add Dockerfile
This commit is contained in:
1 parent
7f759989cb
commit
1b104b7bab
1 file changed
+27
@@ -0,0 +1,27 @@
|
|||||||
|
# BUILD
|
||||||
|
FROM node:12-alpine as build
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
COPY package.json package-lock.json ./
|
||||||
|
RUN npm ci
|
||||||
|
|
||||||
|
COPY . .
|
||||||
|
|
||||||
|
# Building app
|
||||||
|
RUN npm run build
|
||||||
|
|
||||||
|
# RUNTIME
|
||||||
|
FROM node:12-alpine
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
COPY package.json package-lock.json ./
|
||||||
|
RUN npm install --production
|
||||||
|
|
||||||
|
COPY --from=build /app/build ./build
|
||||||
|
|
||||||
|
EXPOSE 80
|
||||||
|
ENV PORT 80
|
||||||
|
ENV NODE_ENV production
|
||||||
|
|
||||||
|
# Running the app
|
||||||
|
CMD [ "npm", "start" ]
|
||||||
Reference in new issue
Block a user