oramap/Dockerfile
dvirlabs 5a7585f755
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
Convert to full-stack app with Docker support
- Restructured app with backend/ and public/ directories
- Created Express backend with /api/search endpoint
- Added health check endpoint at /api/health
- Optimized Dockerfile with multi-stage build
- Added docker-compose.yml for easy deployment
- Updated README with comprehensive documentation
- Added .dockerignore for optimized builds
- Backend listens on 0.0.0.0 for Docker compatibility
2026-03-24 08:47:26 +02:00

36 lines
742 B
Docker

# Multi-stage build for Ora Map Application
FROM node:20-alpine AS base
# Production stage
FROM base AS production
WORKDIR /app
# Copy backend package files
COPY backend/package*.json ./backend/
WORKDIR /app/backend
RUN npm install --production
# Copy backend source and data
COPY backend/ ./
WORKDIR /app
# Copy public frontend files
COPY public/ ./public/
# Expose port
EXPOSE 3000
# Set environment variable
ENV NODE_ENV=production
ENV PORT=3000
# Health check
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
CMD node -e "require('http').get('http://localhost:3000/api/health', (r) => {process.exit(r.statusCode === 200 ? 0 : 1)})"
# Start the application
WORKDIR /app/backend
CMD ["node", "server.js"]