mirror of
https://github.com/Dvorinka/Containr.git
synced 2026-10-28 07:41:27 +00:00
- Replace redis:7-alpine with Dragonfly (Redis-protocol compatible; go-redis client unchanged) in root, infra, and backend-dev compose files. Bounded defaults --proactor_threads/--maxmemory so it boots on small VPSs. - Frontend now defaults to same-origin API calls; nginx proxies /api/* to the backend (WebSocket-aware, docker DNS resolver for upstream re-resolution). Removes the baked localhost:8082 that broke installs reached by IP/domain. - /auth/bootstrap returns configured OAuth providers; the UI hides GitHub/Google buttons unless real credentials exist. Self-hosted stays email/password only - OAuth reserved for a future managed offering. - Sidecar ignores PLACEHOLDER_* OAuth credentials and trusts same-host origins dynamically (Origin host == request Host) so remote installs pass origin checks without config; cross-origin requests still rejected. - install.sh writes ENVIRONMENT=production; COOKIE_SECURE=false in production is now a startup warning instead of fatal (plain-HTTP installs). - Bootstrap failure surfaces an error notice instead of silently rendering the sign-in page. Authored By: TDvorak <[email protected]> Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
61 lines
1.4 KiB
Docker
61 lines
1.4 KiB
Docker
# Build stage
|
|
FROM node:22-alpine AS builder
|
|
|
|
# Set working directory
|
|
WORKDIR /app
|
|
|
|
# Copy package files
|
|
COPY package*.json ./
|
|
|
|
# Install dependencies
|
|
RUN npm ci
|
|
|
|
# Copy source code
|
|
COPY . .
|
|
|
|
# Build-time API URL injection for Vite. Empty = same-origin via the nginx
|
|
# /api/ proxy, which keeps the published image usable from any host.
|
|
ARG VITE_API_URL=
|
|
ARG VITE_AUTH_URL=
|
|
ENV VITE_API_URL=${VITE_API_URL}
|
|
ENV VITE_AUTH_URL=${VITE_AUTH_URL}
|
|
|
|
# Build the application
|
|
RUN npm run build
|
|
|
|
# Production stage
|
|
FROM nginx:alpine
|
|
|
|
# Copy custom nginx config
|
|
COPY nginx.conf /etc/nginx/nginx.conf
|
|
|
|
# Copy built assets from builder stage
|
|
COPY --from=builder /app/dist /usr/share/nginx/html
|
|
|
|
# Create non-root user
|
|
RUN addgroup -g 1001 -S appgroup && \
|
|
adduser -u 1001 -S appuser -G appgroup
|
|
|
|
# Change ownership of nginx directories
|
|
RUN chown -R appuser:appgroup /usr/share/nginx/html && \
|
|
chown -R appuser:appgroup /var/cache/nginx && \
|
|
chown -R appuser:appgroup /var/log/nginx && \
|
|
chown -R appuser:appgroup /etc/nginx/conf.d
|
|
|
|
# Create nginx PID directory
|
|
RUN touch /var/run/nginx.pid && \
|
|
chown -R appuser:appgroup /var/run/nginx.pid
|
|
|
|
# Switch to non-root user
|
|
USER appuser
|
|
|
|
# Expose port
|
|
EXPOSE 80
|
|
|
|
# Health check
|
|
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
|
|
CMD wget --no-verbose --tries=1 --spider http://127.0.0.1:80 || exit 1
|
|
|
|
# Start nginx
|
|
CMD ["nginx", "-g", "daemon off;"]
|