Something went wrong. Try again.
AtAuth
Something went wrong. Try again.
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768# ATAuth Gateway# AT Protocol OAuth gateway with OIDC provider support## Build: docker build -t atauth-gateway .# Run: docker run -p 3100:3100 -v ./data:/app/data atauth-gateway
# ============================================# Stage 1: Build Gateway Backend# ============================================FROM node:20-alpine AS backend-builder
WORKDIR /app
# Install dependenciesCOPY package.json package-lock.json* ./RUN npm ci
# Build TypeScriptCOPY tsconfig.json ./COPY src/ ./src/RUN npm run build
# ============================================# Stage 2: Production Image# ============================================FROM node:20-alpine
WORKDIR /app
# Create non-root userRUN addgroup -g 1001 atauth && \ adduser -u 1001 -G atauth -s /bin/sh -D atauth
# Install production dependencies onlyCOPY package.json package-lock.json* ./RUN npm ci --omit=dev && npm cache clean --force
# Copy built backendCOPY --from=backend-builder /app/dist ./dist
# Create writable data directory owned by app user# Note: node_modules/dist stay root-owned (read-only is fine)# Avoid chown -R /app which is extremely slow on overlay2+ZFSRUN mkdir -p /app/data && chown atauth:atauth /app/data
# Switch to non-root userUSER atauth
# Build metadataARG BUILD_COMMIT=unknownENV BUILD_COMMIT=${BUILD_COMMIT}
# Environment defaultsENV NODE_ENV=production \ PORT=3100 \ HOST=0.0.0.0 \ DB_PATH=/app/data/gateway.db
# Health checkHEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \ CMD wget --no-verbose --tries=1 --spider http://localhost:3100/health || exit 1
EXPOSE 3100
VOLUME ["/app/data"]
CMD ["node", "dist/index.js"]