2025-01-21 17:53:19 +02:00
|
|
|
# Use this image as the platform to build the app
|
|
|
|
FROM node:20 AS build
|
|
|
|
|
|
|
|
# The WORKDIR instruction sets the working directory for everything that will happen next
|
|
|
|
WORKDIR /app
|
|
|
|
|
|
|
|
# Install packages
|
|
|
|
RUN yarn global add pnpm
|
|
|
|
|
|
|
|
COPY package.json .
|
|
|
|
RUN pnpm i
|
|
|
|
|
|
|
|
COPY . .
|
|
|
|
|
2025-02-12 06:56:18 +02:00
|
|
|
RUN pnpm drizzle-kit generate \
|
|
|
|
&& pnpm drizzle-kit push \
|
|
|
|
&& pnpm build
|
2025-02-12 04:45:44 +02:00
|
|
|
|
2025-01-21 17:53:19 +02:00
|
|
|
|
|
|
|
FROM node:20
|
|
|
|
|
|
|
|
WORKDIR /app
|
|
|
|
|
|
|
|
COPY --from=build /app/build /app/build
|
|
|
|
COPY --from=build /app/package.json /app/package.json
|
2025-02-12 04:36:32 +02:00
|
|
|
COPY --from=build /app/local.db /app/local.db
|
2025-02-12 06:56:18 +02:00
|
|
|
COPY --from=build /app/drizzle /app/drizzle
|
2025-01-21 17:53:19 +02:00
|
|
|
|
|
|
|
RUN npm install --omit=dev --legacy-peer-deps
|
|
|
|
|
|
|
|
# This is the command that will be run inside the image when you tell Docker to start the container
|
|
|
|
CMD ["node", "build/index.js"]
|