Repository navigation
Expand file tree
/
Copy pathDockerfile.dev
More file actions
70 lines (56 loc) · 2.22 KB
/
Copy pathDockerfile.dev
File metadata and controls
70 lines (56 loc) · 2.22 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
70
# Development Dockerfile with hot reload support
FROM ghcr.io/astral-sh/uv:debian AS base
# Install Node.js, pnpm, and Tini
RUN apt-get update && apt-get install -y \
curl \
gnupg \
&& curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \
&& apt-get install -y nodejs \
&& npm install -g pnpm@10.12.0 \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# Install Docker CLI for container management
RUN apt-get update && apt-get install -y \
docker.io \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# Install Tini for proper signal handling and zombie process cleanup
RUN apt-get update && apt-get install -y tini \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# Development stage
FROM base AS dev
WORKDIR /app
ENV NEXT_TELEMETRY_DISABLED 1
ENV NODE_ENV=development
ENV WATCHPACK_POLLING=true
ENV CHOKIDAR_USEPOLLING=true
# Copy package files for dependency installation
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./
COPY turbo.json ./
# Copy package.json files from all workspaces (needed for dependency installation)
COPY apps/frontend/package.json ./apps/frontend/
COPY apps/backend/package.json ./apps/backend/
COPY packages/eslint-config/package.json ./packages/eslint-config/
COPY packages/trpc/package.json ./packages/trpc/
COPY packages/typescript-config/package.json ./packages/typescript-config/
COPY packages/zod-types/package.json ./packages/zod-types/
# Install all dependencies (including dev dependencies)
RUN pnpm install
# Copy source code directories (will be overridden by volume mounts, but ensures structure exists)
# This ensures the directory structure is present even if volumes don't mount correctly
COPY apps ./apps
COPY packages ./packages
# Expose ports
EXPOSE 12008 12009
# Health check for development
HEALTHCHECK --interval=30s --timeout=30s --start-period=5s --retries=3 \
CMD curl -f http://localhost:12008/health || exit 1
# Copy entrypoint script
COPY docker-entrypoint-dev.sh ./
RUN chmod +x docker-entrypoint-dev.sh && \
ls -la docker-entrypoint-dev.sh
# Use Tini as the init process to handle signals and zombie processes properly
ENTRYPOINT ["/usr/bin/tini", "--"]
# Use the development entrypoint script
CMD ["./docker-entrypoint-dev.sh"]