freeleaps-service-hub/apps/metrics/Dockerfile
weicao 44f08eee68 Add metrics service with user registration API endpoints
- Add complete metrics microservice structure
- Implement StarRocks database integration
- Add user registration data query APIs:
  - Daily registered users by date range
  - Recent N days registration data
  - Registration data by start date and days
  - Registration summary statistics
- Add comprehensive error handling and logging
- Include test scripts and documentation
2025-09-11 17:35:20 +08:00

38 lines
1.1 KiB
Docker

FROM python:3.10-slim-bullseye
# docker settings
ARG CONTAINER_APP_ROOT="/app"
ENV APP_NAME="metrics"
# Service dependencies
ENV DEVSVC_WEBAPI_URL_BASE="http://devsvc:8007/api/devsvc"
ENV NOTIFICATION_WEBAPI_URL_BASE="http://notification:8003/api/notification/"
# JWT settings
ENV JWT_SECRET_KEY="8f87ca8c3c9c3df09a9c78e0adb0927855568f6072d9efc892534aee35f5867b"
ENV JWT_ALGORITHM="HS256"
# Site settings
ENV SERVICE_API_ACCESS_HOST=0.0.0.0
ENV SERVICE_API_ACCESS_PORT=8009
ENV MONGODB_NAME=freeleaps2
ENV MONGODB_PORT=27017
ENV MONGODB_URI="mongodb://localhost:27017/"
# Log settings
ENV LOG_BASE_PATH=$CONTAINER_APP_ROOT/log/$APP_NAME
ENV BACKEND_LOG_FILE_NAME=$APP_NAME
ENV APPLICATION_ACTIVITY_LOG=$APP_NAME-activity
WORKDIR ${CONTAINER_APP_ROOT}
COPY requirements.txt .
RUN pip install --upgrade pip
RUN pip install --no-cache-dir -r requirements.txt
COPY . ${CONTAINER_APP_ROOT}
EXPOSE ${SERVICE_API_ACCESS_PORT}
# Using shell to expand environment to ensure pass the actual environment value to uvicorn
CMD uvicorn webapi.main:app --reload --port=$SERVICE_API_ACCESS_PORT --host=$SERVICE_API_ACCESS_HOST