-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathDockerfile
More file actions
43 lines (32 loc) · 801 Bytes
/
Copy pathDockerfile
File metadata and controls
43 lines (32 loc) · 801 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
33
34
35
36
37
38
39
40
41
42
43
# Use Node.js 18 LTS as base image
FROM node:18-alpine
# Set working directory
WORKDIR /app
# Install system dependencies
RUN apk add --no-cache \
python3 \
make \
g++ \
sqlite
# Copy package files
COPY package*.json ./
COPY backend/package*.json ./backend/
# Install dependencies
RUN npm install
RUN cd backend && npm install
# Copy application code
COPY . .
# Build frontend assets (if needed)
# RUN npm run build
# Create data directory for SQLite
RUN mkdir -p /app/backend/data
# Expose port
EXPOSE 3000
# Set environment variables
ENV NODE_ENV=production
ENV PORT=3000
# Health check
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
CMD curl -f http://localhost:3000/health || exit 1
# Start the application
CMD ["node", "backend/server.js"]