Maintaining the application
Logs and Logrotation
- Container-Logs:
docker logs ktdocker0 - Application-Logs: Stored in container volume
/rw/var/logand rotates into/rw/var/log.bak
Log-Rotation
Before midnight, the ktdocker0 container will rotate logs and exit. The container might also terminate in case of an error.
Create a service (e.g. systemd) to start the ktdocker0 container. This service should automatically restart the container in case it terminates.
View logs
# last 100 lines of Container-Logs
sudo docker logs --tail 100 ktdocker0
# Lost files in log directory in container
docker run --rm \
-v ktdocker0rw:/rw \
alpine sh -c "ls -a /rw/var/logs"
Install haproxy. Proxy HTTP requests to all ktdocker containers.
Install nginx webserver and reverse proxy. Configure TLS termination. Proxy HTTP requests to haproxy.
Backups
Backup regularly:
- the database
- the docker volumes