Files
dealplustech/Dockerfile
2026-03-03 10:34:31 +07:00

23 lines
572 B
Docker

# Astro Production Dockerfile
FROM node:20-alpine
WORKDIR /app
# Copy package files
COPY package*.json ./
# Install dependencies (use npm install if no lock file)
RUN if [ -f package-lock.json ]; then npm ci --omit=dev; else npm install --omit=dev; fi
# Copy all source code
COPY . .
# Build Astro project (includes public folder in dist)
RUN npm run build
# Expose port from environment variable (default 80 for Easypanel)
EXPOSE ${PORT:-80}
# Start Astro preview server on the correct port
CMD ["sh", "-c", "npm run preview -- --host 0.0.0.0 --port ${PORT:-80}"]