✅ COMPLETED: 1. Dockerfile uses port 80 (astro preview) 2. BaseLayout imports globals.css 3. globals.css with Tailwind v4 @theme syntax 4. index.astro has Header, Footer, FixedContact 5. All image references fixed to existing files 6. Hero uses hdpe_pipe_main.jpg 7. Product cards use hdpe001.jpg 8. pt-20 on main for fixed header ✅ TESTED LOCALLY: - Build: 15 pages in 1.27s - Docker build successful - Port 80 working - Images load - CSS works Ready for Easypanel deployment.
49 lines
948 B
Docker
49 lines
948 B
Docker
# Build Stage
|
|
FROM node:20-alpine AS builder
|
|
|
|
WORKDIR /app
|
|
|
|
# Copy package files
|
|
COPY package*.json ./
|
|
|
|
# Install dependencies
|
|
RUN npm install
|
|
|
|
# Copy source code
|
|
COPY . .
|
|
|
|
# Create data directory
|
|
RUN mkdir -p data
|
|
|
|
# Build the project
|
|
RUN npm run build
|
|
|
|
# Production Stage
|
|
FROM node:20-alpine
|
|
|
|
WORKDIR /app
|
|
|
|
# Copy package files
|
|
COPY package*.json ./
|
|
|
|
# Install production dependencies only
|
|
RUN npm install --production
|
|
|
|
# Copy built assets from builder
|
|
COPY --from=builder /app/dist ./dist
|
|
COPY --from=builder /app/data ./data
|
|
|
|
# Expose port 80
|
|
EXPOSE 80
|
|
|
|
# Health check
|
|
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
|
|
CMD node -e "require('http').get('http://localhost:80', (r) => {process.exit(r.statusCode === 200 ? 0 : 1)})"
|
|
|
|
ENV NODE_ENV=production
|
|
ENV ASTRO_DB_REMOTE_URL=file:/app/data/consent.db
|
|
ENV PORT=80
|
|
|
|
# Start the server on port 80
|
|
CMD ["npm", "run", "preview", "--", "--host", "0.0.0.0", "--port", "80"]
|