This commit is contained in:
retoor 2025-08-06 12:08:09 +02:00
commit a2157b6101
2 changed files with 115 additions and 0 deletions

66
README.md Normal file
View File

@ -0,0 +1,66 @@
# GlitchTip Docker Compose Setup
This repository contains a Docker Compose configuration for deploying GlitchTip, an open-source error tracking tool similar to Sentry. The setup includes services for PostgreSQL, Redis, the web application, a worker, and a migration step.
## What is this?
This `compose.yml` file defines a multi-container Docker environment to run GlitchTip locally or on your server. It simplifies deployment by orchestrating the necessary services and their configurations.
## How to use
### Prerequisites
- Docker and Docker Compose installed on your machine.
- Basic knowledge of Docker and command-line operations.
### Setup steps
1. **Clone this repository or save the `compose.yml` file locally.**
2. **Create necessary directories:**
```bash
mkdir -p ./postgres-data
mkdir -p ./uploads
```
Since this setup does not use Docker volumes for persistence, you need to manually create the directories for data storage:
3. **Configure environment variables (optional):**
Update the `compose.yml` if you want to change default settings such as domain, email, or secret keys.
4. **Start the services:**
```bash
docker-compose -f compose.yml up -d
```
This command will pull the necessary images and start all services in detached mode.
5. **Access GlitchTip:**
Open your browser and navigate to:
```
http://localhost:8000
```
or replace `localhost` with your server's IP or domain if deploying remotely.
### Notes
- **Directories:** You are responsible for creating and managing the directories used for data persistence (`./postgres-data` and `./uploads`). This approach is intentional to keep things simple and "too cool for Docker volumes."
- **Configuration:** Adjust environment variables in the compose file as needed for your environment.
- **Stopping the services:**
```bash
docker-compose -f compose.yml down
```
## Additional Information
- The `web` service runs the GlitchTip web application.
- The `worker` service handles background tasks using Celery.
- The `migrate` service runs database migrations once during startup.
- The `postgres` and `redis` services are dependencies for the application.

49
compose.yml Normal file
View File

@ -0,0 +1,49 @@
x-environment: &default-env
DATABASE_URL: postgres://postgres:postgres@postgres:5432/postgres
SECRET_KEY: "REPLACE-ME-WITH-ANY-LONG-RANDOM-STRING"
PORT: 8000
GLITCHTIP_DOMAIN: http://localhost:8000 # or https://errors.example.com
EMAIL_URL: consolemail:// # change to smtp+tls://user:pass@host:587
DEFAULT_FROM_EMAIL: glitchtip@example.com
ENABLE_OPEN_USER_REGISTRATION: "True"
x-depends_on: &default-depends
- postgres
- redis
# ---------- services ----------
services:
postgres:
image: postgres:14
restart: unless-stopped
environment:
POSTGRES_HOST_AUTH_METHOD: "trust"
volumes:
- ./postgres-data:/var/lib/postgresql/data
redis:
image: redis:7
restart: unless-stopped
web:
image: glitchtip/glitchtip:v5.0 # use :latest to auto-track new releases
ports: ["127.0.0.1:8000:8000"]
depends_on: *default-depends
environment: *default-env
restart: unless-stopped
volumes:
- ./uploads:/glitchtip/uploads
worker:
image: glitchtip/glitchtip:v5.0
command: celery -A glitchtip worker -B -l INFO
depends_on: *default-depends
environment: *default-env
restart: unless-stopped
migrate:
image: glitchtip/glitchtip:v5.0
command: "./manage.py migrate"
depends_on: *default-depends
environment: *default-env
restart: "no" # runs once then exits