Files
eg-qna/frontend/Dockerfile
Lectom C Han dd89e5fc90
Some checks failed
Deploy to Production / Deploy (push) Failing after 4s
svelt kit test
2025-07-25 14:43:32 +09:00

32 lines
675 B
Docker

# 1. Base image
FROM node:20-alpine AS base
# 2. Install pnpm
RUN npm install -g pnpm
# 3. Set working directory
WORKDIR /app
# 4. Copy dependency files and install dependencies
COPY package.json pnpm-lock.yaml ./
RUN pnpm install --frozen-lockfile
# 5. Copy all source code
COPY . .
# 6. Build the application
RUN pnpm run build
# 7. Set up the final image
FROM base AS final
WORKDIR /app
COPY --from=base /app/.svelte-kit ./.svelte-kit
COPY --from=base /app/node_modules ./node_modules
COPY --from=base /app/package.json ./package.json
# 8. Expose port and start the preview server
EXPOSE 4173
CMD ["pnpm", "run", "preview", "--host", "0.0.0.0", "--port", "4173"]