-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDockerfile.backend
More file actions
61 lines (47 loc) · 1.87 KB
/
Copy pathDockerfile.backend
File metadata and controls
61 lines (47 loc) · 1.87 KB
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# ============================================
# Jet Admin - Backend Container
# ============================================
# Node.js API server
FROM node:20-slim
# Install system dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
postgresql-client \
openssl \
netcat-openbsd \
wget \
python3 \
g++ \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
# Copy root package files (for workspace resolution)
COPY package*.json ./
# Copy workspace package.json files
COPY apps/backend/package*.json ./apps/backend/
COPY packages/datasource-types/package*.json ./packages/datasource-types/
COPY packages/datasources-logic/package*.json ./packages/datasources-logic/
COPY packages/expression-engine/package*.json ./packages/expression-engine/
COPY packages/widget-types/package*.json ./packages/widget-types/
COPY packages/widgets-logic/package*.json ./packages/widgets-logic/
# Install dependencies
RUN npm install --legacy-peer-deps
# Copy source files
COPY apps/backend/ ./apps/backend/
COPY packages/ ./packages/
# (nginx removed — Node.js binds directly to Render's $PORT)
# Generate Prisma client
WORKDIR /app/apps/backend
RUN npx prisma generate
# Copy entrypoint script
COPY docker-entrypoint.backend.sh /entrypoint.sh
RUN sed -i 's/\r$//' /entrypoint.sh && chmod +x /entrypoint.sh
# Create log directory
RUN mkdir -p /app/apps/backend/logs && chmod 755 /app/apps/backend/logs
# Ensure log directory is writable
RUN chown -R www-data:www-data /app/apps/backend/logs
# Expose the default local dev port; Render overrides $PORT at runtime
EXPOSE 8090
# Health check — uses $PORT so it matches wherever Node is listening
HEALTHCHECK --interval=30s --timeout=10s --start-period=30s --retries=3 \
CMD wget --no-verbose --tries=1 --spider http://localhost:${PORT:-8090}/health || exit 1
ENTRYPOINT ["/entrypoint.sh"]
CMD ["npm", "run", "pm2"]