-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
42 lines (29 loc) · 905 Bytes
/
Copy pathDockerfile
File metadata and controls
42 lines (29 loc) · 905 Bytes
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
# Stage 1: Build
FROM node:18-alpine AS builder
# Install pnpm
RUN corepack enable && corepack prepare pnpm@10.18.0 --activate
# Set working directory
WORKDIR /app
# Copy all files
COPY . .
# Install dependencies
RUN pnpm install --frozen-lockfile
# Build all packages
RUN pnpm build
# Stage 2: Production
FROM nginx:alpine
# Install OpenSSL for certificate generation
RUN apk add --no-cache openssl
# Copy nginx configuration
COPY docker/nginx.conf /etc/nginx/nginx.conf
# Copy certificate generation script
COPY docker/generate-cert.sh /usr/local/bin/generate-cert.sh
RUN chmod +x /usr/local/bin/generate-cert.sh
# Generate self-signed certificate
RUN /usr/local/bin/generate-cert.sh
# Copy built files from builder stage
COPY --from=builder /app/apps/studio/dist /usr/share/nginx/html
# Expose ports 80 (HTTP) and 443 (HTTPS)
EXPOSE 80 443
# Start nginx
CMD ["nginx", "-g", "daemon off;"]