- Add environment variable support for Supabase and Pakasir configurations - Create Docker configuration with Nginx for production deployment - Add .env.example with all required environment variables - Remove hardcoded URLs from Supabase client and Checkout component - Add Docker and Nginx configuration files for Coolify deployment 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
47 lines
1.0 KiB
Docker
47 lines
1.0 KiB
Docker
# Build stage
|
|
FROM node:18-alpine AS builder
|
|
|
|
# Set working directory
|
|
WORKDIR /app
|
|
|
|
# Copy package files
|
|
COPY package*.json ./
|
|
|
|
# Install dependencies (including dev dependencies for build)
|
|
RUN npm ci
|
|
|
|
# Copy source code
|
|
COPY . .
|
|
|
|
# Build the application
|
|
RUN npm run build
|
|
|
|
# Production stage
|
|
FROM nginx:alpine AS production
|
|
|
|
# Copy custom nginx configuration
|
|
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
|
|
|
# Copy built assets from builder stage
|
|
COPY --from=builder /app/dist /usr/share/nginx/html
|
|
|
|
# Create non-root user (optional but recommended for security)
|
|
RUN addgroup -g 1001 -S nodejs
|
|
RUN adduser -S nextjs -u 1001
|
|
|
|
# Change ownership of the nginx directory
|
|
RUN chown -R nextjs:nodejs /usr/share/nginx/html
|
|
RUN chown -R nextjs:nodejs /var/cache/nginx
|
|
RUN chown -R nextjs:nodejs /var/log/nginx
|
|
RUN chown -R nextjs:nodejs /etc/nginx/conf.d
|
|
RUN touch /var/run/nginx.pid
|
|
RUN chown -R nextjs:nodejs /var/run/nginx.pid
|
|
|
|
# Switch to non-root user
|
|
USER nextjs
|
|
|
|
# Expose port 80
|
|
EXPOSE 80
|
|
|
|
# Start nginx
|
|
CMD ["nginx", "-g", "daemon off;"] |