mirror of
https://github.com/tiennm99/phow2sim.git
synced 2026-06-03 10:13:37 +00:00
7f8990fd30
The hard ${MODEL_URL:?...} gate made 'docker compose up' fail at config
parsing if no .env existed — container never started, no logs beyond
compose's own error. Now:
- MODEL_URL defaults to empty in compose. The Python loader checks at
startup and raises a clear FileNotFoundError naming the missing path
and the two ways to fix it (set MODEL_URL, or mount a local file).
- Document an alternative local-mount flow in README, mirroring
word2sim's ./vectors.bin pattern.
- Add container_name: phow2sim for easier docker ps / docker logs.
22 lines
758 B
YAML
22 lines
758 B
YAML
services:
|
|
phow2sim:
|
|
build: .
|
|
container_name: phow2sim
|
|
ports:
|
|
- "8001:8000"
|
|
environment:
|
|
# URL serving the PhoW2V zip with a plain GET. Any auth goes in
|
|
# the URL itself (share token, signed URL, etc.) — the service
|
|
# sends no Authorization header. Leave empty only if you've
|
|
# pre-populated the volume (see the volume mount below).
|
|
MODEL_URL: ${MODEL_URL:-}
|
|
MODEL_PATH: ${MODEL_PATH:-/data/phow2v/word2vec_vi_words_300dims.txt}
|
|
volumes:
|
|
- phow2v-cache:/data/phow2v
|
|
# Or mount a locally-downloaded .txt and skip MODEL_URL entirely:
|
|
# - ./models/word2vec_vi_words_300dims.txt:/data/phow2v/word2vec_vi_words_300dims.txt:ro
|
|
restart: unless-stopped
|
|
|
|
volumes:
|
|
phow2v-cache:
|