Something went wrong. Try again.
AtAuth
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657# ATAuth Gateway# AT Protocol OAuth gateway for self-hosted authentication## Build: docker build -t atauth-gateway .# Run: docker run -p 3100:3100 -v ./data:/app/data atauth-gateway
FROM node:20-alpine AS builder
WORKDIR /app
# Install dependenciesCOPY package.json ./RUN npm install
# Build TypeScriptCOPY tsconfig.json ./COPY src/ ./src/RUN npm run build
# Production imageFROM 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 ./RUN npm install --omit=dev && npm cache clean --force
# Copy built filesCOPY --from=builder /app/dist ./dist
# Create data directoryRUN mkdir -p /app/data && chown -R atauth:atauth /app/data
# Switch to non-root userUSER atauth
# 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"]