Add Docker support and update Vite config for container dev

- Add Dockerfile for Node-based Vite dev server setup
- Add empty docker-compose.yml as placeholder
- Set Vite to listen on 0.0.0.0 and strict port 5173 in config
This commit is contained in:
2025-08-21 17:16:18 -05:00
parent 7e8827136d
commit 58bf32379f
3 changed files with 30 additions and 0 deletions

25
Dockerfile Normal file
View File

@@ -0,0 +1,25 @@
# Use official Node.js image
FROM node:20
# Set working directory
WORKDIR /app
# Copy only package.json and package-lock.json for install step
COPY package.json ./
# If you have a package-lock.json or pnpm-lock.yaml/yarn.lock, copy it as well
# COPY package-lock.json ./
# Install dependencies
RUN npm install
# Now copy the rest of the app
COPY . .
# Expose the Vite dev server port
EXPOSE 5173
# Set environment variable if desired (can be overridden in compose)
ENV HOST=0.0.0.0
# Default command runs Vite dev server
CMD ["npm", "run", "dev", "--", "--host", "0.0.0.0"]

0
docker-compose.yml Normal file
View File

View File

@@ -3,5 +3,10 @@ import react from '@vitejs/plugin-react'
import tailwind from '@tailwindcss/vite'
export default defineConfig({
server: {
host: '0.0.0.0', // or 'my.local.dev'
port: 5173,
strictPort: true
},
plugins: [react(), tailwind()],
})