Open K0nkere opened 1 year ago
На основе файла с переменными env.sh вида
export BUCKET=chat-bot
Установить переменные
chmod +x env.sh
. env.sh
Докерфайл должен содержать строки вида (для каждой переменной)
ARG BUCKET
ENV BUCKET=$BUCKET
Билд образа
docker build -t service-image:latest \
--build-arg BUCKET=$BUCKET \
.
должен быть создан файл .env
docker run -it --rm -p 9696:9696 --env-file=".env" actions-server:latest
version: '3'
networks:
txt2python-network:
volumes:
models:
ollama:
open-webui:
services:
ollama-service:
container_name: ollama-service
build:
context: .
dockerfile: Dockerfile
expose:
- 11400
environment:
- OLLAMA_HOST=0.0.0.0:11400
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: 1
capabilities: [gpu]
volumes:
- "/raid/ml-models:/models"
- "ollama:/root/.ollama"
ports:
- "11400:11400"
networks:
- txt2python-network
webUI:
container_name: ollama-webUI
image: ghcr.io/open-webui/open-webui:main
expose:
- 8080
ports:
- "8080:8080"
environment:
- OLLAMA_BASE_URL=http://ollama-service:11400
depends_on:
- ollama-service
volumes:
- open-webui:/app/backend/data
networks:
- txt2python-network
Ignore checking context of files and folders while building the docker context Create
.dockerignore
file in the same directory as the Dockerfile: