add vendor dir to dockerfile

This commit is contained in:
Graham McIntire 2026-01-26 17:22:31 -06:00
parent 6c238c52e5
commit e94cae3435
No known key found for this signature in database
2 changed files with 12 additions and 0 deletions

View file

@ -41,6 +41,7 @@ ENV MIX_ENV="prod"
# install mix dependencies # install mix dependencies
COPY mix.exs mix.lock ./ COPY mix.exs mix.lock ./
COPY vendor vendor
RUN --mount=type=cache,target=/root/.hex \ RUN --mount=type=cache,target=/root/.hex \
--mount=type=cache,target=/root/.mix \ --mount=type=cache,target=/root/.mix \
mix deps.get --only $MIX_ENV mix deps.get --only $MIX_ENV

11
vendor/README.md vendored
View file

@ -9,6 +9,17 @@ These dependencies are vendored to:
- Ensure consistent builds without external dependencies - Ensure consistent builds without external dependencies
- Enable offline development - Enable offline development
## Docker Build
**IMPORTANT**: The `vendor/` directory must be copied into the Docker build before running `mix deps.get`.
In `Dockerfile`, ensure this order:
```dockerfile
COPY mix.exs mix.lock ./
COPY vendor vendor # ← Must be before mix deps.get
RUN mix deps.get --only $MIX_ENV
```
## Vendored Packages ## Vendored Packages
### Oban Pro ### Oban Pro