Initial commit
This commit is contained in:
26
web/Dockerfile
Normal file
26
web/Dockerfile
Normal file
@@ -0,0 +1,26 @@
|
||||
# Frontend Dockerfile - Vite React App
|
||||
FROM node:20-alpine
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Copy package files first (for better caching when only code changes)
|
||||
COPY package*.json ./
|
||||
|
||||
# Install dependencies to a cache location (will be copied to volume on start)
|
||||
RUN npm ci && cp -r node_modules /node_modules_cache
|
||||
|
||||
# Copy entrypoint script
|
||||
COPY docker-entrypoint.sh /usr/local/bin/
|
||||
RUN chmod +x /usr/local/bin/docker-entrypoint.sh
|
||||
|
||||
# Copy source code
|
||||
COPY . .
|
||||
|
||||
# Expose Vite dev server port
|
||||
EXPOSE 5173
|
||||
|
||||
# Use entrypoint to initialize node_modules volume if empty
|
||||
ENTRYPOINT ["docker-entrypoint.sh"]
|
||||
|
||||
# Run Vite dev server (accessible from outside container)
|
||||
CMD ["npm", "run", "dev", "--", "--host", "0.0.0.0"]
|
||||
Reference in New Issue
Block a user