add vendor dir to dockerfile
This commit is contained in:
parent
6c238c52e5
commit
e94cae3435
2 changed files with 12 additions and 0 deletions
|
|
@ -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
11
vendor/README.md
vendored
|
|
@ -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
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue