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

Commit

Permalink
Add docker setup example
Browse files Browse the repository at this point in the history
  • Loading branch information
sikmir committed Sep 1, 2020
1 parent eaf11b8 commit bcba196
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 1 deletion.
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

0 comments on commit bcba196

Please sign in to comment.