Skip to content

BE-12: Deployment (Docker + Cloudflare Workers) #12

@tecnodeveloper

Description

@tecnodeveloper

Set up deployment strategy using Docker and deploy the application using Cloudflare Workers (or compatible platform).

** Important Note (Design Decision)**

Cloudflare Workers do NOT natively support Express + SQLite in the traditional way.

So this ticket includes:

  • Research feasibility
  • Adjust architecture if needed (likely required)

Goals

  • Containerize the app
  • Deploy to cloud environment
  • Ensure production readiness

Tasks

Research

  • Investigate Cloudflare Workers limitations:
    • No traditional Node.js server
    • No filesystem (SQLite limitation)
  • Evaluate alternatives:
    • Cloudflare Pages + Functions
    • Cloudflare D1 (SQLite-compatible DB)
    • Or switch deployment target (Render, Fly.io, Railway)
  • Document decision:
    • Keep SQLite locally + change prod DB?
    • Or switch to D1?

Docker

  • Build Docker image:
docker build -t bookstore-api .
  • Run container locally:
docker run -p 3000:3000 bookstore-api
  • Verify app works inside container

Deployment Strategy

  • Choose deployment platform:
    • Cloudflare Workers (if adapted)
    • OR alternative (Render / Fly.io recommended)

If Using Cloudflare Workers

  • Refactor app (if needed):
    • Use Fetch API instead of Express OR adapter
  • Setup Wrangler CLI
  • Configure project
  • Deploy worker

If Using Alternative (Recommended)

  • Deploy Docker container to:
    • Render / Fly.io / Railway
  • Configure environment variables
  • Verify public API access

Acceptance Criteria

  • App runs in Docker container
  • Deployment platform selected and justified
  • App accessible via public URL
  • API endpoints working in production

Definition of Done

  • Deployment completed
  • App accessible online
  • Documentation updated (README)
  • Trade-offs documented

Optional (Nice to Have)

  • Add CI/CD (GitHub Actions)
  • Auto-deploy on push
  • Add production logging
  • Add health check endpoint for uptime monitoring

Metadata

Metadata

Labels

No labels
No labels

Projects

Status

Backlog

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions