-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
53 lines (38 loc) · 1.15 KB
/
Dockerfile
File metadata and controls
53 lines (38 loc) · 1.15 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
# Build stage
FROM geoffreybooth/meteor-base:3.3.2 as builder
# Set working directory
WORKDIR /app
# Copy package files first
COPY package*.json ./
# Install npm dependencies before building
RUN meteor npm install
# Copy rest of application files
COPY . .
# Build the Meteor application (cache busting handled by Render's auto-deploy)
RUN meteor build --directory /build --server-only --architecture os.linux.x86_64
# Production stage
FROM node:18-bullseye-slim
# Install runtime dependencies with updated OpenSSL
RUN apt-get update && apt-get install -y \
ca-certificates \
openssl \
&& rm -rf /var/lib/apt/lists/*
# Set OpenSSL configuration for better compatibility
ENV OPENSSL_CONF=/etc/ssl/openssl.cnf
ENV NODE_OPTIONS="--tls-min-v1.0"
ENV NODE_TLS_REJECT_UNAUTHORIZED=0
# Copy built bundle from builder
COPY --from=builder /build/bundle /app
# Set working directory
WORKDIR /app/programs/server
# Install npm dependencies
RUN npm install --production
# Set working directory to app root
WORKDIR /app
# Set environment variables
ENV PORT=3000
ENV NODE_ENV=production
# Expose port
EXPOSE 3000
# Start the application
CMD ["node", "main.js"]