-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.dev
More file actions
108 lines (85 loc) · 4.96 KB
/
Copy pathDockerfile.dev
File metadata and controls
108 lines (85 loc) · 4.96 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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
# ══════════════════════════════════════════════════════════════════════════════
# Stage 1 — Go + Air
# ══════════════════════════════════════════════════════════════════════════════
FROM golang:1.26-alpine AS go-builder
RUN apk add --no-cache gcc musl-dev
WORKDIR /app
COPY go.mod go.sum ./
RUN go mod download
RUN go install github.com/air-verse/air@latest
COPY server/ ./server/
RUN mkdir -p /app/tmp && go build -o /app/tmp/aether-server ./server/
# ══════════════════════════════════════════════════════════════════════════════
# Stage 2 — Node.js / pnpm
# ══════════════════════════════════════════════════════════════════════════════
FROM node:25-alpine AS node-builder
WORKDIR /app
RUN npm install -g corepack --force && corepack enable && corepack prepare pnpm@9.15.4 --activate
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml .npmrc ./
COPY apps/package.json ./apps/
RUN mkdir -p apps/next/fond/google && \
printf 'module.exports = {};\n' > apps/next/fond/google/index.js && \
printf '{"name":"google","version":"0.0.0"}\n' > apps/next/fond/google/package.json && \
pnpm install --filter @vaelixbank/apps... --ignore-scripts --no-frozen-lockfile
# ══════════════════════════════════════════════════════════════════════════════
# Stage 3 — Final (server / worker / postgresql) — default build target
# ══════════════════════════════════════════════════════════════════════════════
FROM node:25-alpine
RUN apk add --no-cache \
ca-certificates \
tzdata \
curl \
bash \
git \
wget \
build-base \
libc6-compat \
postgresql \
postgresql-client \
openssl \
npm \
gosu \
coreutils \
inotify-tools
ENV GOPATH="/go"
ENV PATH="/usr/local/go/bin:/go/bin:/root/go/bin:/root/.local/share/corepack:/usr/local/bin:/usr/bin:/bin:${PATH}"
ENV SCHEMA_PATH=/app/server/prisma/schema.prisma
ENV PRISMA_DIR=/app/server/prisma
ENV DEPLOY_SCRIPT=/usr/local/bin/deploy-schema.sh
RUN npm install -g corepack --force && corepack enable && corepack prepare pnpm@9.15.4 --activate && \
ln -sf /root/.local/share/corepack/pnpm /usr/local/bin/pnpm
WORKDIR /app
RUN mkdir -p /certs /templates
# ── Binaires Go ───────────────────────────────────────────────────────────────
COPY --from=go-builder /go/bin/air /go/bin/air
COPY --from=go-builder /usr/local/go /usr/local/go
COPY --from=go-builder /app/server/ ./server/
COPY --from=go-builder /app/tmp/aether-server /app/tmp/aether-server
# ── node_modules ─────────────────────────────────────────────────────────────
COPY --from=node-builder /app/node_modules ./node_modules/
COPY --from=node-builder /app/apps/node_modules ./apps/node_modules/
# ── Sources Next.js (écrasées par le volume mount en dev) ────────────────────
COPY apps/package.json ./apps/
COPY apps/tsconfig.json ./apps/
COPY apps/next.config.ts ./apps/
COPY apps/postcss.config.mjs ./apps/
COPY apps/components.json ./apps/
COPY apps/eslint.config.mjs ./apps/
COPY apps/app/ ./apps/app/
COPY apps/components/ ./apps/components/
COPY apps/context/ ./apps/context/
COPY apps/hooks/ ./apps/hooks/
COPY apps/lib/ ./apps/lib/
COPY apps/public/ ./apps/public/
COPY apps/styles/ ./apps/styles/
COPY ./middleware.ts ./apps/middleware.ts
COPY server/prisma/ ./server/prisma/
RUN cd server/prisma && npm install --no-audit --no-fund
# ── Config dev ───────────────────────────────────────────────────────────────
COPY .air.toml ./
COPY .env.example ./
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
EXPOSE 3000
EXPOSE 8080
ENTRYPOINT ["/entrypoint.sh"]