I Don't Know Why This Would Fix It

This commit is contained in:
Annika Merris 2024-02-05 09:44:06 -05:00
parent 0b62980340
commit a2be864314

View file

@ -9,22 +9,20 @@ WORKDIR /app
# install dependencies into temp directory
# this will cache them and speed up future builds
FROM base as install
# install with --production (exclude devDependencies)
RUN mkdir -p /temp/prod
COPY package.json bun.lockb /temp/prod/
RUN cd /temp/prod && bun install --frozen-lockfile --production
RUN mkdir -p /temp/dev
COPY package.json bun.lockb /temp/dev/
RUN cd /temp/dev && bun install --frozen-lockfile
# copy node_modules from temp directory
# then copy all (non-ignored) project files into the image
FROM node:21-bookworm AS prerelease
WORKDIR /app
COPY --from=install /temp/prod/node_modules node_modules
FROM base AS prerelease
COPY --from=install /temp/dev/node_modules node_modules
COPY . .
# I don't have any tests, I am bad.
# [optional] tests & build
ENV NODE_ENV=production
RUN npx vite build
RUN bunx --bun vite build
# Copy the distribution folder into the final image.
FROM nginx:stable-alpine as release