rybbit/docker-compose.yml
Bill Yang d10017686f
Add caddy (#90)
* Add Nginx and Certbot services to Docker Compose

- Introduced Nginx service with custom configuration for handling HTTP and HTTPS traffic, including volume mounts for templates and entrypoint script.
- Added Certbot service for automated SSL certificate management, with a renewal loop and environment variable support for domain and email.
- Updated existing services to include restart policies and removed unnecessary port mappings for backend and client services.
- Enhanced volume management by adding certbot-conf and certbot-www for certificate storage and challenge handling.

* remove volume

* Replace Nginx and Certbot with Caddy in Docker Compose

- Removed Nginx and Certbot services, streamlining the configuration for SSL management.
- Introduced Caddy service with automatic HTTPS support and simplified volume management.
- Updated environment variables for domain and email configuration, ensuring compatibility with Caddy's setup.
- Enhanced volume definitions for persistent data and configuration storage.

* Fix

* Fix

* Remove Nginx and Certbot configurations from Docker setup

- Deleted Nginx and Certbot Dockerfiles, entrypoint scripts, and associated configuration files to streamline the project.
- Updated docker-compose.yml to remove Certbot email configuration, reflecting the transition to Caddy for SSL management.

* Remove version declaration from docker-compose.yml to simplify configuration

* Refactor login page to simplify account creation prompt

- Removed conditional rendering for the sign-up link, ensuring it is always displayed for better user accessibility.

* Update self-hosting documentation for Frogstats

- Revamped the self-hosting guide to provide clearer instructions for setting up Frogstats.
- Added prerequisites section detailing requirements such as a Linux VPS, domain name, Docker, and Git.
- Enhanced setup steps with detailed commands for installing Docker and Git, cloning the repository, and running the setup script.
- Included a callout for compatibility with Ubuntu 24 LTS and emphasized the importance of HTTPS for tracking scripts.
2025-04-16 23:04:17 -07:00

99 lines
2.6 KiB
YAML

services:
caddy:
image: caddy:latest
container_name: caddy
restart: unless-stopped
ports:
- "80:80"
- "443:443"
- "443:443/udp" # Needed for HTTP/3
volumes:
- ./Caddyfile:/etc/caddy/Caddyfile # Mount Caddy config file
- caddy_data:/data # Mount persistent data volume for certs etc.
- caddy_config:/config # Mount persistent config volume
environment:
# Pass domain name for use in Caddyfile
# Email is configured via Caddyfile global options
- DOMAIN_NAME=${DOMAIN_NAME}
depends_on:
- backend
- client
clickhouse:
container_name: clickhouse
image: clickhouse/clickhouse-server:latest
ports:
- "8123:8123"
- "9000:9000"
volumes:
- clickhouse-data:/var/lib/clickhouse
environment:
- CLICKHOUSE_DB=analytics
- CLICKHOUSE_USER=default
- CLICKHOUSE_PASSWORD=frog
healthcheck:
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:8123/ping"]
interval: 3s
timeout: 5s
retries: 5
start_period: 10s
restart: unless-stopped
postgres:
image: postgres:latest
container_name: postgres
environment:
POSTGRES_USER: frog
POSTGRES_PASSWORD: frog
POSTGRES_DB: analytics
volumes:
- postgres-data:/var/lib/postgresql/data
restart: unless-stopped
backend:
container_name: backend
build:
context: ./server
dockerfile: Dockerfile
environment:
- NODE_ENV=production
- CLICKHOUSE_HOST=http://clickhouse:8123
- CLICKHOUSE_DB=analytics
- CLICKHOUSE_PASSWORD=frog
- POSTGRES_HOST=postgres
- POSTGRES_PORT=5432
- POSTGRES_DB=analytics
- POSTGRES_USER=frog
- POSTGRES_PASSWORD=frog
- BETTER_AUTH_SECRET=${BETTER_AUTH_SECRET}
- BASE_URL=${BASE_URL}
- STRIPE_SECRET_KEY=${STRIPE_SECRET_KEY}
- STRIPE_WEBHOOK_SECRET=${STRIPE_WEBHOOK_SECRET}
- CLOUD=${CLOUD}
depends_on:
clickhouse:
condition: service_healthy
postgres:
condition: service_started
restart: unless-stopped
client:
container_name: client
build:
context: ./client
dockerfile: Dockerfile
args:
NEXT_PUBLIC_BACKEND_URL: ${BASE_URL}
environment:
- NODE_ENV=production
- NEXT_PUBLIC_BACKEND_URL=${BASE_URL}
- CLOUD=${CLOUD}
depends_on:
- backend
restart: unless-stopped
volumes:
clickhouse-data:
postgres-data:
caddy_data: # Persistent volume for Caddy's certificates and state
caddy_config: # Persistent volume for Caddy's configuration cache (optional but good practice)