From 6aaaaccb1293c79c610a304ef6d8c84a084debc5 Mon Sep 17 00:00:00 2001 From: diegosouzapw Date: Fri, 20 Feb 2026 01:47:22 -0300 Subject: [PATCH] fix: set DATA_DIR=/app/data in Dockerfile and docker-compose.yml MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Ensures the Docker volume mount at /app/data matches the app data directory. Previously DATA_DIR was not set, causing the app to default to ~/.omniroute/ which is not backed by the volume — leading to empty database on redeploys. --- Dockerfile | 3 ++- docker-compose.yml | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index e043709550..308389163a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -20,7 +20,8 @@ ENV NODE_ENV=production ENV PORT=20128 ENV HOSTNAME=0.0.0.0 -# Runtime writable location for localDb when DATA_DIR is configured to /app/data +# Data directory inside Docker — must match the volume mount in docker-compose.yml +ENV DATA_DIR=/app/data RUN mkdir -p /app/data COPY --from=builder /app/public ./public diff --git a/docker-compose.yml b/docker-compose.yml index ea3c72f679..0b936ffb08 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -18,6 +18,8 @@ x-common: &common restart: unless-stopped env_file: .env + environment: + - DATA_DIR=/app/data # Must match the volume mount below volumes: - omniroute-data:/app/data healthcheck: