mirror of
https://github.com/StepanovPlaton/AboutMe.git
synced 2026-04-03 12:20:48 +04:00
Update docker deploy
This commit is contained in:
19
Dockerfile
19
Dockerfile
@@ -4,14 +4,6 @@ FROM node:22-alpine AS builder
|
||||
# Set working directory
|
||||
WORKDIR /app
|
||||
|
||||
# Accept build arguments
|
||||
ARG OAUTH_GITHUB_CLIENT_ID
|
||||
ARG OAUTH_GITHUB_CLIENT_SECRET
|
||||
|
||||
# Set environment variables from build args
|
||||
ENV OAUTH_GITHUB_CLIENT_ID=${OAUTH_GITHUB_CLIENT_ID}
|
||||
ENV OAUTH_GITHUB_CLIENT_SECRET=${OAUTH_GITHUB_CLIENT_SECRET}
|
||||
|
||||
# Copy package files
|
||||
COPY package.json package-lock.json* ./
|
||||
|
||||
@@ -21,19 +13,28 @@ RUN npm ci
|
||||
# Copy source code
|
||||
COPY . .
|
||||
|
||||
# Accept build arguments and set environment variables
|
||||
ARG OAUTH_GITHUB_CLIENT_ID
|
||||
ARG OAUTH_GITHUB_CLIENT_SECRET
|
||||
ENV OAUTH_GITHUB_CLIENT_ID=${OAUTH_GITHUB_CLIENT_ID}
|
||||
ENV OAUTH_GITHUB_CLIENT_SECRET=${OAUTH_GITHUB_CLIENT_SECRET}
|
||||
|
||||
# Build the application
|
||||
RUN npm run build
|
||||
|
||||
# Stage 2: Production
|
||||
FROM nginx:alpine AS production
|
||||
|
||||
# Remove default nginx config
|
||||
RUN rm -f /etc/nginx/conf.d/default.conf
|
||||
|
||||
# Copy built files from builder stage
|
||||
COPY --from=builder /app/dist /usr/share/nginx/html
|
||||
|
||||
# Copy nginx configuration
|
||||
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
||||
|
||||
# Expose port 8091 (for rootless podman)
|
||||
# Expose port 8091
|
||||
EXPOSE 8091
|
||||
|
||||
# Start nginx
|
||||
|
||||
Reference in New Issue
Block a user