Comments (3)
ok
there where mixed issues
i managed to make postgres to work
i head to docker inspect network net
(net was my network name)
and grab the subnet and gateway
"Config": [
{
"Subnet": "192.168.96.0/20",
"Gateway": "192.168.96.1"
}
i ued the subnet on the
ipam:
config:
- subnet:192.168.96.0/20
in the docker-compose
and the gateway in the database url in the traccar.xml jdbc:postgresql://192.168.96.1:5432/db
beyond that i had to use the official traccar debian arm64 image for my raspberrypi 400 so i can have the traccar web interface
Digest:sha256:f09791c90dbfe9ea5adeb5c5c1f657cfdb1eccaf56bda2194f2a84abfb4b6412
i tried the images from dockerhub before and they threw errors
unfortunately i dont remember which ones
maybe 5x
so i ended up using the dockerfile from this guy and it worked with the embeded db
#61 (comment)
but when using this dockerfile with postgres i couldnt get the traccar UI on port 8082 instead i was getting the database dir
and last i would like to suggest to provide an "official" docker-compose for completely dockerised spinups
i'll leave "mine" here for reference
version: "3"
services:
traccar:
image: traccar/traccar:debian
hostname: my.dyn-dns.domain.com
container_name: traccar
restart: unless-stopped
environment:
POSTGRES_USER: user
POSTGRES_DB: db
depends_on:
- traccar-db
volumes:
- /run/media/ippo/TOSHIBA/traccar/logs:/opt/traccar/logs:rw
- /run/media/ippo/TOSHIBA/traccar/conf/traccar.xml:/opt/traccar>
- /run/media/ippo/TOSHIBA/traccar/data:/opt/traccar/web:rw
ports:
- "82:8082"
- "5055:5055/tcp"
networks:
- net
traccar-db:
container_name: traccar-db
image: postgres:13
restart: unless-stopped
ports:
- 5432:5432
volumes:
- /run/media/ippo/TOSHIBA/traccar/db:/var/lib/postgresql/data
environment:
POSTGRES_PASSWORD: imus
networks:
- net
networks:
net:
driver: bridge
enable_ipv6: false
ipam:
config:
- subnet: 192.168.96.0/20
thanks and keep up
from traccar-docker.
I'll re open this as it looks like traccar doesnot want to use postgres
So I managed to start the 2 images without errors and thought all was OK
But when I docker exec -it traccar-db bash
I see that there are no tables created
And when I docker exec -it traccar ls /opt/traccar/data
I see the database.mv.db database.trace.db the h2 creates
So traccar still uses h2
The mounted data volume does not contain any db files though and it makes.no diference if I mount traccar/data volume or not
Also I read similar issues
that contain "fixes" like decompile>edit>recompile. Jar files
Creating tables scripts
etc
The traccar documentation for psql
https://www.traccar.org/postgresql/
All it States is reaplace [DATABASE], [USER], [PASSWORD] in the configuration xml
from traccar-docker.
Ok
I think I finaly made mysql to work
I had to create the db and user manualy after all
I thought docker-compose would do that for me
Anyway....
docker exec -it traccar-db mysql -u root -p
CREATE DATABASE IF NOT EXISTS traccar-db
utf8mb4
grant all privileges on `traccar-db`.* TO `user'@'%` identified by `pass`
flush privileges
\q
Traccar is up and running and /opt/traccar/data is empty so I guess it uses the mariadb
from traccar-docker.
Related Issues (20)
- WebUI shows 404 - Not found HOT 3
- Docker-compose support HOT 17
- Docker-compose path/fiile problem. "Are you trying to mount a directory onto a file?" HOT 3
- MySQL DB is locked HOT 1
- Docker Hub alternative HOT 4
- Cant get traccar.xml HOT 2
- Docker - No Matching Manifest HOT 4
- version 5.8 HOT 1
- MariaDB 11.0.2 connection error - Got an error reading communication packets HOT 3
- Container keeps restarting and udp port not working HOT 1
- Container with the preview version to solve the MariaDB 11 problem HOT 3
- Can't pull image on Raspberry Pi - archive/tar: invalid tar header.
- Update Docker image to OpenJDK 17
- GUI failed login requests not being logged HOT 1
- Can't add new connection to device HOT 1
- embed site to wordpress HOT 1
- How to increase java RAM limit in existing Traccar docker container HOT 2
- Support for environment variables and files HOT 5
- change Java heap size HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from traccar-docker.