-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
50 lines (34 loc) · 1.45 KB
/
Dockerfile
File metadata and controls
50 lines (34 loc) · 1.45 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
# ─── Stage 1: Build the Meteor bundle ─────────────────────────────────────────
FROM node:22-bookworm AS builder
# Install OS dependencies required by Meteor & its npm packages
RUN apt-get update && apt-get install -y \
curl \
python3 \
build-essential \
&& rm -rf /var/lib/apt/lists/*
# Install Meteor (pinned to the project's release)
ENV HOME=/root
RUN curl https://install.meteor.com/?release=3.3.2 | sh
ENV PATH="$PATH:/root/.meteor"
ENV METEOR_ALLOW_SUPERUSER=true
WORKDIR /app
# Copy the full project (node_modules and .meteor/local are excluded by .dockerignore)
COPY . .
# Remove Meteor testModule from package.json
RUN node scripts/remove-test-module.js
# Install npm dependencies inside the Meteor toolchain
RUN meteor npm ci
# Build a production Node.js bundle
RUN meteor build /bundle --directory --architecture os.linux.x86_64
# ─── Stage 2: Lightweight production image ────────────────────────────────────
FROM node:22-slim AS runtime
WORKDIR /app
# Copy the compiled bundle from the builder stage
COPY --from=builder /bundle/bundle .
# Install only the server-side npm dependencies
RUN cd programs/server && npm install --omit=dev
# Cloud Run expects the app to listen on PORT (default 8080)
ENV PORT=8080
ENV NODE_ENV=production
EXPOSE 8080
CMD ["node", "main.js"]