mirror of
https://github.com/PretendoNetwork/SSSL-DNS.git
synced 2026-04-25 15:26:47 -05:00
chore: add app directory argument to DNS Dockerfile
This commit is contained in:
parent
c6b5ab0748
commit
b1f8b98b11
|
|
@ -1,8 +1,11 @@
|
|||
# syntax=docker/dockerfile:1
|
||||
|
||||
ARG app_dir="/home/node/app"
|
||||
|
||||
# * Base Node.js image
|
||||
FROM node:20-alpine AS base
|
||||
WORKDIR /home/node/app
|
||||
ARG app_dir
|
||||
WORKDIR ${app_dir}
|
||||
|
||||
|
||||
# * Installing production dependencies
|
||||
|
|
@ -15,7 +18,7 @@ RUN --mount=type=bind,source=package.json,target=package.json \
|
|||
|
||||
|
||||
# * Installing development dependencies and building the application
|
||||
FROM dependencies AS build
|
||||
FROM base AS build
|
||||
|
||||
RUN --mount=type=bind,source=package.json,target=package.json \
|
||||
--mount=type=bind,source=package-lock.json,target=package-lock.json \
|
||||
|
|
@ -28,6 +31,7 @@ RUN npm run build
|
|||
|
||||
# * Running the final application
|
||||
FROM base AS final
|
||||
ARG app_dir
|
||||
|
||||
RUN npm install -g pm2
|
||||
|
||||
|
|
@ -36,7 +40,7 @@ USER node
|
|||
|
||||
COPY package.json .
|
||||
|
||||
COPY --from=dependencies /home/node/app/node_modules ./node_modules
|
||||
COPY --from=build /home/node/app/dist ./dist
|
||||
COPY --from=dependencies ${app_dir}/node_modules ${app_dir}/node_modules
|
||||
COPY --from=build ${app_dir}/dist ${app_dir}/dist
|
||||
|
||||
CMD pm2 start . --no-daemon
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user