Files
dealplustech/Dockerfile
Kunthawat f04218b350 fix: Change port to 80 for Easypanel compatibility
- Standard HTTP port for web servers
- Better compatibility with hosting platforms
2026-03-10 14:10:44 +07:00

44 lines
810 B
Docker

# Astro Dockerfile (Multi-stage build)
# Build Stage
FROM node:20-alpine AS builder
WORKDIR /app
# Create data directory for database
RUN mkdir -p /app/data
COPY package*.json ./
RUN npm ci
COPY . .
RUN npm run build
# Production Stage
FROM node:20-alpine
WORKDIR /app
# Install SQLite runtime
RUN apk add --no-cache sqlite-libs
# Copy package files
COPY package*.json ./
RUN npm ci --production
# Copy built assets
COPY --from=builder /app/dist ./dist
COPY --from=builder /app/public ./public
COPY --from=builder /app/astro.config.mjs ./
# Create data directory for database
RUN mkdir -p /app/data
EXPOSE 80
ENV NODE_ENV=production
ENV ASTRO_DB_REMOTE_URL=file:/app/data/consent.db
ENV PORT=80
# Start Astro preview server
CMD ["npm", "run", "preview", "--", "--host", "0.0.0.0", "--port", "80"]