Docker
Run your own event calendar and ticketing with Docker Compose: four containers, one .env file, and no PHP or cron to set up on the host.
Feature overview: Open source event calendar
Overview
The eventschedule/dockerfiles repository runs Event Schedule with Docker Compose. It builds the app from source and starts four containers, so there is no PHP, web server or cron to set up on the host.
| Service | What it does |
|---|---|
| app | PHP-FPM running the application. Runs the database migrations each time it starts. |
| web | Nginx, serving the app on port 8080 of the host. |
| db | MariaDB 11, with its data in the dbdata volume. |
| scheduler | Runs the app's scheduled tasks every minute: reminders, scheduled newsletters, calendar sync and the queue. This is the cron entry of a manual install. |
A Docker install is a full selfhosted install: every feature is on, with no plan or license key. The Selfhost overview lists how it differs from the hosted service. To install without Docker, follow the manual installation guide.
Requirements
- Docker Engine 24 or newer, with the Compose v2 plugin (
docker compose, notdocker-compose) - Internet access on the machine that builds the image: the build downloads the app's source and its PHP and JavaScript dependencies
- For anything beyond a local test, a domain name and a reverse proxy that serves HTTPS (step 4)
1. Get the Docker Files
git clone https://github.com/eventschedule/dockerfiles.git eventschedule
cd eventschedule
The repository ships a working .env for a local test. Open it and set the database password, and the address you will open the app at:
DB_PASSWORD=pick-a-long-random-password
APP_URL=http://localhost:8080
Docker Compose reads the same DB_PASSWORD to create the database user, so it is set in one place. Leave APP_URL as it is for a local test; for a real domain it changes in step 4.
2. Fix the Application Key
APP_KEY encrypts sessions and the credentials saved in the app, such as a schedule's mail password. The image generates one when it is built, so a later rebuild generates a different one: everybody is signed out and data encrypted with the old key can no longer be read. Generate a key once and keep it in .env:
docker compose run --rm app php artisan key:generate --show
This first command also builds the image, which takes several minutes. The last line it prints is the key, starting with base64:. Uncomment the APP_KEY= line in .env and paste it in:
APP_KEY=base64:your-key-here
Store .env with your backups. A database restored without the key it was encrypted with loses every saved credential.
3. Start the Stack
docker compose up -d
docker compose ps
The app container waits for the database, runs the migrations and starts. Follow it with docker compose logs -f app if it takes a while.
Then open http://localhost:8080/sign_up and create your account. The first account on the install becomes its admin, and public sign-up closes once it exists: you add people from a schedule's Team tab, or reopen sign-up with ALLOW_REGISTRATION=true in .env.
A manual install opens on a browser setup wizard. The Docker install does not need it: the database is configured by Compose, and the migrations have already run, so you go straight to creating your account.
4. Serve It Over HTTPS
Outside a local test, put the app behind a reverse proxy that serves HTTPS. Event Schedule generates https:// links whenever APP_ENV is not local, so these settings change together in .env:
APP_ENV=production
APP_URL=https://events.example.com
SESSION_SECURE_COOKIE=true
TRUSTED_PROXIES=*
TRUSTED_PROXIES lets the app believe the proxy when it says the visit came in over HTTPS; without it every page redirects to itself. * is safe when only your proxy can reach port 8080; otherwise list the proxy's address. Running behind a reverse proxy has the details.
With Caddy, the whole proxy configuration is:
events.example.com {
reverse_proxy localhost:8080
}
For SWAG, the repository includes eventschedule.subdomain.conf.sample for its proxy-confs folder. Nginx Proxy Manager and Traefik work the same way: point them at port 8080. When the proxy runs on the same machine, change the web service's port in docker-compose.yml to "127.0.0.1:8080:80" so the app is not reachable from outside around it.
Containers read .env when they are created, so apply any change to it with:
docker compose up -d
5. Set Up Email
Email carries ticket confirmations, password resets and team invites, so set it up before you sell anything. Add your SMTP server to .env:
MAIL_MAILER=smtp
MAIL_HOST=smtp.example.com
MAIL_PORT=587
[email protected]
MAIL_PASSWORD=your-smtp-password
[email protected]
MAIL_FROM_NAME="Your Venue"
Port 465 uses SSL and any other port upgrades with STARTTLS. Run docker compose up -d to apply it. The Email guide covers the other drivers and what is sent when.
6. Sell Tickets
On a selfhosted install, the money from every ticket sale goes to one Stripe account that you control, and event creators have nothing to connect. Add your keys and the webhook's signing secret to .env:
STRIPE_PLATFORM_KEY=pk_live_...
STRIPE_PLATFORM_SECRET=sk_live_...
STRIPE_PLATFORM_WEBHOOK_SECRET=whsec_...
The webhook points at https://events.example.com/stripe/webhook with the checkout.session.completed event; until its secret is set, no sale is marked paid. After docker compose up -d, edit an event, open its Tickets tab, choose Sell tickets and set the payment method to Stripe. The Payments guide walks through each step, and covers PayPal, Payfast, Razorpay and Invoice Ninja.
Backups
Everything is in two volumes: dbdata (the database) and storage (uploaded images and files). Compose prefixes them with the folder name, so in an eventschedule folder they are eventschedule_dbdata and eventschedule_storage.
# The database
docker compose exec db sh -c 'mariadb-dump -ueventschedule -p"$MYSQL_PASSWORD" eventschedule' > eventschedule-$(date +%F).sql
# Uploaded files
docker run --rm -v eventschedule_storage:/data -v "$PWD":/backup alpine \
tar czf /backup/storage-$(date +%F).tar.gz -C /data .
Keep .env with them: it holds the application key the saved credentials are encrypted with.
Updating
The image copies Event Schedule's source when it is built, so updating means building it again. Docker caches that step, so build without the cache, then recreate the containers:
git pull
docker compose build --no-cache
docker compose up -d
git pull picks up changes to the Docker files themselves. The migrations run when the app container starts. Take a backup first.
Settings > App Update still offers an Update button in Docker. Do not use it there: it rewrites the files inside the running app container, which are replaced by the image the next time the container is created, and the web container keeps serving the old build. Rebuild instead.
The image builds from the main branch. To stay on a release instead, set APP_REF to a release tag such as v1.0.140 for both the app and scheduler services in docker-compose.yml, and change it when you update. The release notes list what each one changes.
Troubleshooting
Every page redirects to itself
The app is behind a proxy it does not trust, so it believes each visit came in over plain HTTP and sends it to HTTPS again. Set TRUSTED_PROXIES as in step 4.
Links in emails point to localhost
APP_URL is still http://localhost:8080. Set it to the address people use, then run docker compose up -d.
Everybody was signed out after an update
The rebuilt image generated a new application key. Put a fixed key in .env as in step 2. If the install ran with a key you did not save, credentials saved under it have to be entered again.
Page Expired when signing in
SESSION_SECURE_COOKIE=true needs HTTPS. On a plain http:// address, such as a local test, keep it false.
Reminders and scheduled newsletters are not sent
Check that the scheduler is running with docker compose ps, and read its output with docker compose logs -f scheduler.