fix: skip migrations during build phase to prevent 'table already exists' errors

This commit is contained in:
Marko Djordjevic 2026-02-16 19:41:22 +01:00
parent ecb23855b5
commit bbaf330020
4 changed files with 40 additions and 9 deletions

View file

@ -325,7 +325,7 @@ curl -X POST http://localhost:8001/predict \
The easiest way to deploy is with docker-compose:
```bash
docker-compose up --build
docker compose up --build
```
This will:
@ -497,6 +497,23 @@ docker-compose up -d
docker-compose logs -f --tail=100
```
**ML service healthcheck failing:**
If the candle-annotator service fails to start with error "dependency failed to start: container candle_annotator-ml-service-1 is unhealthy", this is because the ml-service healthcheck requires `curl` to be installed in the container. This was fixed in commit `ecb2385` by adding curl to the ml-service Dockerfile.
If you encounter this issue:
1. Rebuild the ml-service: `docker compose build ml-service`
2. Restart services: `docker compose up -d`
**Migration errors during build:**
If you see Drizzle migration errors like "table `annotations` already exists" during the Docker build process, this means the database file from a previous build is being included. This was fixed in commit by skipping migrations during the build phase. The migrations now only run at runtime.
If you encounter this issue:
1. Ensure `data/` is in `.dockerignore`
2. Rebuild: `docker compose build --no-cache candle-annotator`
3. Restart: `docker compose up -d`
### Update Procedure
To update the application: