forked from vkondepati/fleet-route-optimizer
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.api
More file actions
32 lines (23 loc) · 719 Bytes
/
Dockerfile.api
File metadata and controls
32 lines (23 loc) · 719 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# Fleet Route Optimizer - API Server Dockerfile
FROM node:18-alpine
# Install curl for health checks
RUN apk add --no-cache curl
# Set working directory
WORKDIR /app
# Copy package files
COPY package*.json ./
# Install dependencies
RUN npm install --production
# Copy application code
COPY src/api/server.js ./
COPY fleet-optimizer-postgres.html ./
# Create public directory and copy HTML file
RUN mkdir -p public
COPY fleet-optimizer-postgres.html public/index.html
# Expose ports for API and WebSocket
EXPOSE 3001 3002
# Health check
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
CMD curl -f http://localhost:3001/health || exit 1
# Start the API server
CMD ["node", "server.js"]