58 lines
No EOL
1.3 KiB
Docker
58 lines
No EOL
1.3 KiB
Docker
# FROM node:18-alpine as build
|
|
|
|
# WORKDIR /app
|
|
|
|
# # Copy package files first for better layer caching
|
|
# COPY package*.json ./
|
|
|
|
# # Use npm install instead of npm ci to resolve dependency mismatches
|
|
# RUN npm install
|
|
|
|
# # Copy the rest of the application
|
|
# COPY . .
|
|
|
|
# # Make sure we have a public directory for static assets
|
|
# RUN mkdir -p public
|
|
|
|
# # Build the application
|
|
# RUN npm run build
|
|
|
|
# # Production stage
|
|
# FROM nginx:alpine
|
|
|
|
# # Copy built assets from the build stage
|
|
# COPY --from=build /app/dist /usr/share/nginx/html
|
|
|
|
# # Copy custom nginx config if it exists, otherwise create a basic one
|
|
# # COPY nginx.conf /etc/nginx/conf.d/default.conf 2>/dev/null || echo 'server { \
|
|
# # listen 80; \
|
|
# # root /usr/share/nginx/html; \
|
|
# # index index.html; \
|
|
# # location / { \
|
|
# # try_files $uri $uri/ /index.html; \
|
|
# # } \
|
|
# # location /api/ { \
|
|
# # proxy_pass http://backend:4000; \
|
|
# # } \
|
|
# # }' > /etc/nginx/conf.d/default.conf
|
|
|
|
# EXPOSE 80
|
|
|
|
# CMD ["nginx", "-g", "daemon off;"]
|
|
|
|
# frontend/Dockerfile.dev
|
|
FROM node:18-alpine
|
|
|
|
WORKDIR /app
|
|
|
|
COPY package*.json ./
|
|
RUN npm install
|
|
|
|
# Don't copy source files - they will be mounted as a volume
|
|
# COPY . .
|
|
|
|
# Expose the Vite dev server port
|
|
EXPOSE 3000
|
|
|
|
# Run the dev server
|
|
CMD ["npm", "run", "dev", "--", "--host", "0.0.0.0"] |