mirror of
https://github.com/plausible/analytics.git
synced 2024-12-25 18:48:06 +03:00
ff9e4b444b
This means the migrations can always be run on startup, meaning the database won't get out of sync with the running application. It also means users who don't set the credential variables in their compose files don't keep creating admin users every time the application starts.
76 lines
1.8 KiB
YAML
76 lines
1.8 KiB
YAML
# NOTE:
|
|
# This Docker-compose file is created as a sample and should not be used directly for production
|
|
# You can adjust the settings as-per your environment
|
|
version: "3.3"
|
|
services:
|
|
|
|
# As it says, this service is a fake smtp server which accepts SMTP connections
|
|
# the inbox is available at localhost:8025, in actuality, you need to use a proper smtp server
|
|
fake_smtp:
|
|
image: mailhog/mailhog:v1.0.0
|
|
ports:
|
|
- 1025:1025
|
|
- 8025:8025
|
|
healthcheck:
|
|
test: echo | telnet 127.0.0.1 1025
|
|
|
|
|
|
plausible_db:
|
|
image: postgres:12
|
|
command: ["postgres", "-c", "log_statement=all", "-c", "log_destination=stderr"]
|
|
volumes:
|
|
- db-data:/var/lib/postgresql/data
|
|
environment:
|
|
- POSTGRES_PASSWORD=postgres
|
|
- POSTGRES_DB=plausible_db
|
|
- POSTGRES_USER=postgres
|
|
ports:
|
|
- 5432:5432
|
|
|
|
plausible_events_db:
|
|
image: yandex/clickhouse-server:latest
|
|
volumes:
|
|
- event-data:/var/lib/clickhouse
|
|
ports:
|
|
- 8123:8123
|
|
|
|
plausible:
|
|
build:
|
|
context: .
|
|
dockerfile: ./Dockerfile
|
|
command: sh -c "sleep 10 && /entrypoint.sh db migrate && /entrypoint.sh run"
|
|
depends_on:
|
|
- plausible_db
|
|
- plausible_events_db
|
|
- fake_smtp
|
|
ports:
|
|
- 80:8080
|
|
links:
|
|
- plausible_db
|
|
- plausible_events_db
|
|
- fake_smtp
|
|
env_file:
|
|
- plausible-variables.sample.env
|
|
|
|
|
|
setup:
|
|
build:
|
|
context: .
|
|
dockerfile: ./Dockerfile
|
|
command: sh -c "sleep 10 && /entrypoint.sh db createdb && /entrypoint.sh db migrate && /entrypoint.sh db init-admin"
|
|
depends_on:
|
|
- plausible_db
|
|
- plausible_events_db
|
|
links:
|
|
- plausible_db
|
|
- plausible_events_db
|
|
env_file:
|
|
- plausible-variables.sample.env
|
|
|
|
|
|
volumes:
|
|
db-data:
|
|
driver: local
|
|
event-data:
|
|
driver: local
|