gohorsejobs/seeder-api/Dockerfile
Tiago Yamamoto 2ed84f6d56 refactor(seeder): convert to API service and fix SSL connection
- Refactored seeder to Express API with /seed and /reset endpoints
- Updated Dockerfile to run server.js
- Fixed DB connection for managed postgres (stripped sslmode)
- Fixed tags seeder export syntax
- Preserved CLI functionality
2026-01-02 09:19:01 -03:00

33 lines
800 B
Docker

# =============================================================================
# GoHorse Jobs Seeder API - Production Dockerfile
# =============================================================================
FROM mirror.gcr.io/library/node:20-alpine
WORKDIR /app
# Install dependencies
COPY package*.json ./
RUN npm ci --only=production && npm cache clean --force
# Copy source
COPY src/ ./src/
# Security: Run as non-root
RUN addgroup -g 1001 -S nodejs && \
adduser -u 1001 -S seeder -G nodejs && \
chown -R seeder:nodejs /app
USER seeder
# Environment
ENV NODE_ENV=production \
PORT=3001
EXPOSE 3001
# Health check
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
CMD wget -qO- http://localhost:3001/health || exit 1
CMD ["node", "src/server.js"]