Skip to content

Instantly share code, notes, and snippets.

@hyoretsu
Created March 28, 2024 00:12
Show Gist options
  • Save hyoretsu/e69a289fa41c75784d5d07a399f2d0e7 to your computer and use it in GitHub Desktop.
Save hyoretsu/e69a289fa41c75784d5d07a399f2d0e7 to your computer and use it in GitHub Desktop.
FROM node:20-slim AS base
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
# Install OpenSSL for Prisma
RUN apt-get update && apt-get install -y openssl
RUN corepack enable
FROM base AS deps
WORKDIR /app
COPY package.json pnpm-lock.yaml ./
RUN pnpm i --frozen-lockfile
FROM base AS build
WORKDIR /app
COPY --from=deps /app/package.json /app/pnpm-lock.yaml ./
COPY --from=deps /app/node_modules ./node_modules
COPY app ./app
COPY common ./common
COPY hooks ./hooks
COPY lib ./lib
COPY prisma ./prisma
COPY public ./public
COPY utils ./utils
COPY myTypes.ts postcss.config.js remix.config.js tailwind.config.ts tsconfig.json ./
RUN pnpm prisma generate
RUN ls
RUN pnpm build
FROM base
WORKDIR /app
ENV NODE_ENV="production"
COPY --from=deps /app/package.json /app/pnpm-lock.yaml ./
COPY --from=build /app/build ./build
COPY --from=build /app/node_modules ./node_modules
COPY --from=build /app/public ./public
COPY remix.config.js shopify.app.toml shopify.web.toml ./
RUN pnpm prune --prod
EXPOSE 3000
CMD ["pnpm", "start"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment