mirror of
https://github.com/senju1337/senju.git
synced 2025-12-24 07:39:29 +00:00
feat: Create ollama container and pull initial image.
Refs: OPS-17, OPS-12, OPS,10
This commit is contained in:
parent
c2d6cd822a
commit
c72ee2617e
4 changed files with 27 additions and 6 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
|
@ -171,3 +171,6 @@ cython_debug/
|
||||||
.pypirc
|
.pypirc
|
||||||
.python-version
|
.python-version
|
||||||
pyrightconfig.json
|
pyrightconfig.json
|
||||||
|
|
||||||
|
# Ollama Local Dir
|
||||||
|
ollama
|
||||||
|
|
|
||||||
10
Dockerfile
10
Dockerfile
|
|
@ -3,21 +3,21 @@ FROM python:3.12-alpine AS base
|
||||||
# VENV not needed in docker container
|
# VENV not needed in docker container
|
||||||
ENV POETRY_VIRTUALENVS_CREATE=false
|
ENV POETRY_VIRTUALENVS_CREATE=false
|
||||||
|
|
||||||
|
COPY ./entrypoint.sh /
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
# Install dependencies
|
# Install dependencies
|
||||||
|
RUN apk add curl
|
||||||
RUN pip install poetry
|
RUN pip install poetry
|
||||||
RUN poetry install
|
RUN poetry install
|
||||||
|
|
||||||
|
|
||||||
FROM base as dev
|
FROM base as dev
|
||||||
|
|
||||||
# Expose development port
|
# Expose development port
|
||||||
EXPOSE 5000
|
EXPOSE 5000
|
||||||
|
|
||||||
# Include host flag to make flask listen on all interfaces
|
RUN chmod +x /entrypoint.sh
|
||||||
# Otherwise it is not accessible from the outside.
|
ENTRYPOINT ["/entrypoint.sh"]
|
||||||
CMD [ "flask", "--app", "senju/main", "run", "--debug", "--host=0.0.0.0"]
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,22 @@
|
||||||
services:
|
services:
|
||||||
senju:
|
senju:
|
||||||
build:
|
build:
|
||||||
build: .
|
context: .
|
||||||
target: dev
|
target: dev
|
||||||
ports:
|
ports:
|
||||||
- "127.0.0.1:5000:5000"
|
- "127.0.0.1:5000:5000"
|
||||||
volumes:
|
volumes:
|
||||||
- .:/app
|
- .:/app
|
||||||
|
depends_on:
|
||||||
|
- ollama
|
||||||
|
|
||||||
|
ollama:
|
||||||
|
image: docker.io/ollama/ollama
|
||||||
|
volumes:
|
||||||
|
- ./ollama:/root/.ollama
|
||||||
|
container_name: ollama
|
||||||
|
environment:
|
||||||
|
- OLLAMA_KEEP_ALIVE=24h
|
||||||
|
- OLLAMA_HOST=0.0.0.0
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
6
entrypoint.sh
Normal file
6
entrypoint.sh
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
curl http://ollama:11434/api/pull -d '{"model": "llama3.2:1b"}'
|
||||||
|
|
||||||
|
flask --app senju/main run --debug --host=0.0.0.0
|
||||||
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue