mirror of
https://github.com/netlight/my-finance-pal-backend.git
synced 2024-09-19 20:21:07 +02:00
Introduce Dockerfile for containerizing the application
This commit is contained in:
parent
a9e39afb6d
commit
f19b3aca80
2 changed files with 30 additions and 0 deletions
3
.dockerignore
Normal file
3
.dockerignore
Normal file
|
@ -0,0 +1,3 @@
|
|||
node_modules
|
||||
generated
|
||||
dist
|
27
Dockerfile
Normal file
27
Dockerfile
Normal file
|
@ -0,0 +1,27 @@
|
|||
FROM node:18-alpine3.17 as build
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY package.json yarn.lock ./
|
||||
RUN yarn install
|
||||
|
||||
|
||||
COPY src ./src
|
||||
COPY api ./api
|
||||
COPY env ./env
|
||||
COPY tsconfig.json ./tsconfig.json
|
||||
COPY tsconfig.prod.json ./tsconfig.prod.json
|
||||
|
||||
RUN yarn run build
|
||||
|
||||
FROM node:16-alpine3.15 as app
|
||||
|
||||
USER node
|
||||
WORKDIR /app
|
||||
|
||||
COPY --from=build /app/node_modules /app/node_modules
|
||||
COPY --from=build /app/env /app/dist/env
|
||||
COPY --from=build /app/package.json /app/package.json
|
||||
COPY --from=build /app/dist /app/dist
|
||||
|
||||
ENTRYPOINT node dist/src/server.js
|
Loading…
Reference in a new issue