Skip to content

Commit

Permalink
finally it work
Browse files Browse the repository at this point in the history
  • Loading branch information
sharrlotte committed Oct 25, 2024
1 parent f6d59d3 commit 630a169
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 5 deletions.
8 changes: 5 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,16 @@ ENV LC_ALL=C.UTF-8
RUN pip install --upgrade pip

# Copy project files
COPY . /app
COPY /app /app
COPY docker-compose.yml docker-compose.yml
COPY Dockerfile Dockerfile

# Install Python dependencies
RUN pip install --no-cache-dir -r /app/app/requirements.txt
RUN pip install --no-cache-dir -r /app/requirements.txt
RUN pip install fastapi uvicorn

# Expose FastAPI's default port
EXPOSE 9090

# Run FastAPI server when the container starts
ENTRYPOINT ["uvicorn", "app.app.main:app", "--host", "0.0.0.0", "--port", "9090"]
ENTRYPOINT ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "9090"]
2 changes: 1 addition & 1 deletion app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
app = FastAPI()

# Initialize the LLM model
llm = Ollama(model="qwen2.5:0.5b", temperature=0.9,base_url='http://localhost:11434')
llm = Ollama(model="qwen2.5:0.5b", temperature=0.9, base_url='http://ollama:11434')

# Define the prompt template for translation
prompt = PromptTemplate(
Expand Down
33 changes: 33 additions & 0 deletions docker-compose.dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
version: '3.8'

services:
langchain_api:
build: .
container_name: mindustry-gpt
pull_policy: always
restart: unless-stopped
ports:
- '9090:9090'
networks:
- my_network

ollama:
image: ollama/ollama:latest
container_name: ollama
ports:
- '11434:11434' # Default port for Ollama
volumes:
- ./ollama/ollama:/root/.ollama
- ollama_data:/root/.ollama
pull_policy: always
tty: true
restart: always
networks:
- my_network

volumes:
ollama_data:

networks:
my_network:
driver: bridge
10 changes: 9 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ services:
ports:
- '9090:9090'

networks:
- my_network

ollama:
image: ollama/ollama:latest
container_name: ollama
Expand All @@ -19,7 +22,12 @@ services:
pull_policy: always
tty: true
restart: always

networks:
- my_network

volumes:
ollama_data:

networks:
my_network:
driver: bridge

0 comments on commit 630a169

Please sign in to comment.