You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
36 lines
983 B
36 lines
983 B
# Multi-stage build |
|
FROM node:20-alpine AS builder |
|
WORKDIR /app |
|
COPY package*.json ./ |
|
RUN npm ci |
|
COPY . . |
|
# Optional build args - will use defaults from config.ts if not provided |
|
# If ARG is not provided, ENV will be empty and config.ts will use defaults |
|
ARG VITE_DEFAULT_RELAYS |
|
ARG VITE_THREAD_TIMEOUT_DAYS |
|
ENV VITE_DEFAULT_RELAYS=${VITE_DEFAULT_RELAYS} |
|
ENV VITE_THREAD_TIMEOUT_DAYS=${VITE_THREAD_TIMEOUT_DAYS} |
|
RUN npm run build |
|
|
|
# Production stage - Node.js runtime |
|
FROM node:20-alpine |
|
WORKDIR /app |
|
|
|
# Copy package files and install production dependencies only |
|
COPY package*.json ./ |
|
RUN npm ci --only=production && npm cache clean --force |
|
|
|
# Copy built application from builder stage |
|
COPY --from=builder /app/build ./build |
|
|
|
# Copy entrypoint script |
|
COPY docker-entrypoint.sh /usr/local/bin/ |
|
RUN chmod +x /usr/local/bin/docker-entrypoint.sh |
|
|
|
ARG PORT=9876 |
|
ENV PORT=${PORT} |
|
ENV NODE_ENV=production |
|
ENV HOST=0.0.0.0 |
|
|
|
EXPOSE ${PORT} |
|
ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"]
|
|
|