Closed deanfourie1 closed 5 months ago
Are you using the provided docker compose file or your own? And if so you you post your docker compose
Hi, thanks, here is docker compose
name: dmarc-smtptls-reports
version: "2"
services:
db:
image: mariadb:latest
environment:
MYSQL_DATABASE: dmarc
MYSQL_USER: dmarcuser
MYSQL_PASSWORD: Password!100
MYSQL_ROOT_PASSWORD: Password100!
ports:
- 3306
restart: unless-stopped
healthcheck:
test: [ "CMD", "healthcheck.sh", "--su-mysql", "--connect", "--innodb_initialized" ]
interval: 10s
timeout: 5s
retries: 6
web:
image: antedebaas/dmarc-reports:latest
ports:
- 0.0.0.0:8001:8080
environment:
TZ: Pacific/Auckland
DATABASE_TYPE: mysql
DATABASE_HOST: db
DATABASE_PORT: 3306
DATABASE_NAME: dmarc
DATABASE_USER: dmarcuser
DATABASE_PASSWORD:
MAILER_HOST:
MAILER_SMTPPORT: 465
MAILER_IMAPPORT: 993
MAILER_USER:
MAILER_PASSWORD:
DELETE_PROCESSED_MAILS: false
ENABLE_REGISTRATION: false
MAILCHECK_SCHEDULE: "0 * * * *"
restart: unless-stopped
depends_on:
db:
condition: service_healthy
OMG! I really hope the mail password is not the real one. 😱
You have to make the data persistent by mounting a volume for the mysql database:
**services: db: image: mariadb:latest volumes:
This survives a docker and/or server restart.
Yes that sounds like a good solution. It’s probably because the container gets recreated deleting the data
HAHA yea it was, damn!
You have to make the data persistent by mounting a volume for the mysql database:
services: db: image: mariadb:latest volumes: - ./dmarc-report-db:/var/lib/mysql
This survives a docker and/or server restart.
Yes, I thought it was strange that no volumes were being mounted in the image, I just did not know how to mount a volume correctly.
Thanks for this.
Thanks, this is now resolved.
Reopening as a reminder for me to change the docker compose for future users
added a volume in the docker-compose file
Issue Template
Describe the bug When the docker container is stopped,
docker compose down
and then restarted,
docker compose up -d
All data is lost and I am asked to create a new user, start from scratch
Are you using the Docker image?
Database used
Error Messages No errors, everything works well, but when the container is restarted, everything is gone, users, reports the whole lot.
Steps to Reproduce Please provide detailed steps to reproduce the problem:
Expected behavior All data to be retained when restarting the container.
Environment (please complete the following information):
Additional context Nothing really, that is it.