
Deploying BillingWatch to production with Docker and Stripe webhooks
BillingWatch is a self-hosted billing anomaly detector designed specifically for Stripe subscriptions. In this article, we'll cover how to deploy it in production using Docker and Stripe webhooks. Prerequisites Before starting, ensure you have: Docker installed on your system A Stripe account with webhooks enabled The BillingWatch repository cloned locally Step 1: Set up Docker To set up the environment for our self-hosted BillingWatch instance, we'll create a Dockerfile in the project directory. # Create a new file named Dockerfile touch Dockerfile In this Dockerfile , add the following content: FROM python:3.9-slim # Install required dependencies RUN pip install --upgrade pip && \ pip install -r requirements.txt # Set environment variables ENV DATABASE_URL=<DATABASE_URL> ENV STRIPE_WEBHOOK_SECRET=<STRIPE_WEBHOOK_SECRET> # Copy application code into the container COPY app.py . # Expose port for web server EXPOSE 5000 # Run commands to start web server CMD ["gunicorn", "app:app", "--wo
Continue reading on Dev.to Webdev
Opens in a new tab

