Skip to content
This repository has been archived by the owner on Jun 5, 2023. It is now read-only.

Add docker setup example #15

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ bring your own Postgres server. You also have to provide a config file.

docker run -v /path/to/config.toml:/config.toml -p 8080:8080 thcyron/tracklog

Alternately, use docker-compose to run:

docker-compose up -d
docker exec -it tracklog /bin/tracklog-control -config /config.toml user add <name>

## Installation

First, make sure you have Go and Node.js installed.
Expand Down
2 changes: 1 addition & 1 deletion config.toml.example
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ mapbox_access_token = ""

[db]
driver = "postgres"
dsn = "dbname=tracklog sslmode=disable"
dsn = "postgres://postgres:password@postgres/tracklog?sslmode=disable"
26 changes: 26 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
version: '3'

services:
tracklog:
build: .
image: thcyron/tracklog:latest
container_name: tracklog
entrypoint: /bin/tracklog-server -config /config.toml
restart: always
depends_on:
- postgres
ports:
- 8080:8080
volumes:
- ./config.toml.example:/config.toml

postgres:
image: postgres:12-alpine
container_name: postgres
restart: always
environment:
- POSTGRES_DB=tracklog
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=password
volumes:
- ./pkg/db/postgres.sql:/docker-entrypoint-initdb.d/init.sql