INITIAL COMMIT
This commit is contained in:
31
web/Dockerfile
Normal file
31
web/Dockerfile
Normal file
@ -0,0 +1,31 @@
|
||||
FROM node:18-alpine AS build
|
||||
|
||||
|
||||
#### RUN BUILD IN CONTAINER
|
||||
|
||||
# copy required files
|
||||
WORKDIR /app
|
||||
COPY . .
|
||||
RUN npm install
|
||||
RUN npm run build
|
||||
|
||||
# copy to actual container (prod)
|
||||
FROM node:18-alpine AS web
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# copy required files
|
||||
COPY --from=build /app/build /app/build
|
||||
# COPY --from=build /app/migrations /app/migrations
|
||||
COPY --from=build /app/package.json /app/package-lock.json .
|
||||
|
||||
|
||||
# get production node modules
|
||||
RUN npm ci --omit dev
|
||||
|
||||
# expose port
|
||||
EXPOSE 3000
|
||||
|
||||
|
||||
# run app
|
||||
CMD ["node", "build"]
|
Reference in New Issue
Block a user