Docker / build (push) Failing after 2m55s
- Renamed project from "React + Vite" to "VPS Tracker" and updated the README to reflect the application's purpose and usage instructions. - Added detailed Docker setup instructions, including two methods for running the application: using Docker Compose and standalone Docker. - Implemented static file serving in the server configuration to serve the frontend from the 'dist' directory if it exists, enhancing the application's deployment capabilities.
21 lines
444 B
Docker
21 lines
444 B
Docker
# syntax=docker/dockerfile:1
|
|
|
|
FROM node:22-alpine AS builder
|
|
WORKDIR /app
|
|
COPY package.json package-lock.json ./
|
|
RUN npm ci
|
|
COPY index.html vite.config.js ./
|
|
COPY public ./public
|
|
COPY src ./src
|
|
RUN npm run build
|
|
|
|
FROM node:22-alpine AS runtime
|
|
WORKDIR /app
|
|
ENV NODE_ENV=production
|
|
COPY package.json package-lock.json ./
|
|
RUN npm ci --omit=dev
|
|
COPY server ./server
|
|
COPY --from=builder /app/dist ./dist
|
|
EXPOSE 3001
|
|
CMD ["node", "server/index.js"]
|