This repository contains a simple configuration to get started with Traefik as a reverse proxy using Docker Compose.
- Docker
- Docker Compose
- Domain with cloudflare
- Cloudflare API Key
- Git
First of all i'll asume your domain is setup through cloudflare To create a CloudFlare API token for your DNS zone go to https://dash.cloudflare.com/profile and follow these steps:
- Go to API TOKENS
- Click Create Token
- Click 'Edit zone DNS' from the templates
- On zone Resources click your zone (your domain)
- And Click 'Continue to Summary'
- Click 'Create Token'
- Copy/Paste your API KEY to 'CF_DNS_API_TOKEN= on your .env file'
Asuming you already have the apt repository installed
sudo apt install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin gitgit clone https://github.com/Lilithbtw/traefik-sample.gitUsing your prefered linux text editor just edit the the following lines
- "--certificatesresolvers.myresolver.acme.email=your-email@example.com"
- "traefik.http.routers.nginx.rule=Host(
mydomain.com) || Host(www.mydomain.com)"
nano docker-compose.ymlmkdir src
mkdir letsencrypt
touch letsencrypt/acme.jsonJust copy all your PHP files over to src and then just do and it should be working
docker compose up -d