-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.dev
More file actions
69 lines (54 loc) · 2.26 KB
/
Dockerfile.dev
File metadata and controls
69 lines (54 loc) · 2.26 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
62
63
64
65
66
67
68
69
# =============================================================================
# LITE-SINGLE Development Mode
# Features: Hot reload, bind mounts, live Prisma generation
# =============================================================================
FROM node:20-slim
# Install runtime dependencies
RUN apt-get update && apt-get install -y \
nginx \
supervisor \
ca-certificates \
curl \
default-mysql-client \
jq \
&& rm -rf /var/lib/apt/lists/*
# Install tsx globally for TypeScript execution, pnpm, and Prisma CLI for dev startup
RUN npm install -g tsx pnpm prisma@6.8.2
# Create app directory
WORKDIR /app
# Copy pnpm workspace files
COPY pnpm-workspace.yaml pnpm-lock.yaml tsconfig.json .npmrc ./
# Root package.json is required for pnpm "overrides" to match pnpm-lock.yaml
COPY package.json ./
# Copy package files for dependency installation
COPY @typus-core/backend/package.json @typus-core/backend/
COPY @typus-core/frontend/package.json @typus-core/frontend/
COPY @typus-core/shared/package.json @typus-core/shared/
# Install backend and frontend dependencies
RUN pnpm install --frozen-lockfile --filter @typus-core/backend...
RUN pnpm install --frozen-lockfile --filter @typus-core/frontend...
# Copy nginx configuration for dev mode (proxies to Vite)
COPY docker/configs/nginx-dev.conf /etc/nginx/nginx.conf
COPY docker/configs/redirects.conf /etc/nginx/conf.d/redirects.conf
# Copy supervisord configuration for development
COPY docker/configs/supervisord-dev.conf /etc/supervisor/conf.d/supervisord.conf
# Copy backend startup script (DEV version with Prisma generation)
COPY @typus-core/backend/backend-startup-dev.sh /app/@typus-core/backend/backend-startup-dev.sh
RUN chmod +x /app/@typus-core/backend/backend-startup-dev.sh
# Create required directories
RUN mkdir -p /app/storage/cache/html \
/app/logs \
/var/log/nginx \
/var/log/supervisor \
/var/run \
/app/docker/scripts
# Set environment variables for development
ENV NODE_ENV=development
ENV PORT=3001
# Expose HTTP port
EXPOSE 80
# Health check
HEALTHCHECK --interval=30s --timeout=10s --start-period=60s --retries=3 \
CMD curl -f http://localhost/health || exit 1
# Start supervisord
CMD ["/usr/bin/supervisord", "-n", "-c", "/etc/supervisor/conf.d/supervisord.conf"]