fix: set DATA_DIR=/app/data in Dockerfile and docker-compose.yml

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.
This commit is contained in:
diegosouzapw
2026-02-20 01:47:22 -03:00
parent 282c46fd46
commit 6aaaaccb12
2 changed files with 4 additions and 1 deletions

View File

@@ -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

View File

@@ -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: