Skip to content

Commit c3c67b4

Browse files
authored
Merge pull request #125 from codelion/fix-dockerfile-path
Fix dockerfile path
2 parents 4252dca + d1e0e32 commit c3c67b4

File tree

5 files changed

+46
-8
lines changed

5 files changed

+46
-8
lines changed

.dockerignore

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
.git/
2+
.gitignore
3+
.github/
4+
__pycache__/
5+
*.pyc
6+
*.pyo
7+
*.pyd
8+
.Python
9+
*.so
10+
*.egg
11+
*.egg-info/
12+
dist/
13+
build/
14+
*.egg-info/
15+
.eggs/
16+
.tox/
17+
.coverage
18+
.coverage.*
19+
.cache
20+
nosetests.xml
21+
coverage.xml
22+
*.cover
23+
*.log
24+
.pytest_cache/
25+
.env
26+
.venv/
27+
env/
28+
venv/
29+
ENV/
30+
.idea/
31+
.vscode/

Dockerfile

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
# Build stage
22
FROM python:3.12-slim AS builder
33

4+
# Define build argument with default value
5+
ARG PORT=8000
6+
# Make it available as env variable at runtime
7+
ENV OPTILLM_PORT=$PORT
8+
49
# Set working directory
510
WORKDIR /app
611

@@ -43,8 +48,8 @@ USER appuser
4348
# Set environment variables
4449
ENV PYTHONUNBUFFERED=1
4550

46-
# Expose the port the app runs on
47-
EXPOSE 8000
51+
# Use the ARG in EXPOSE
52+
EXPOSE ${PORT}
4853

4954
# Run the application
50-
CMD ["optillm"]
55+
ENTRYPOINT ["python", "optillm.py"]

docker-compose.yaml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,18 @@ services:
66
dockerfile: Dockerfile
77
tags:
88
- optillm:latest
9+
args:
10+
- PORT=${OPTILLM_PORT:-8000}
911
image: optillm:latest
1012
container_name: *name
1113
hostname: *name
1214
ports:
13-
- "8000:8000"
15+
- "${OPTILLM_PORT:-8000}:${OPTILLM_PORT:-8000}"
1416
env_file:
1517
- .env
1618
environment:
1719
OPENAI_API_KEY: ${OPENAI_API_KEY:-""}
20+
OPTILLM_PORT: ${OPTILLM_PORT:-8000}
1821
# OPTILLM_BASE_URL: ${OPENAI_BASE_URL:-"https://openrouter.ai/api/v1"} # can be set to any OpenAI API compatible endpoint
1922
# OPTILLM_API_KEY: ${OPTILLM_API_KEY:-} # optionally sets an API key for Optillm clients
2023
# Uncomment and set values for other arguments (prefixed with OPTILLM_) as needed, e.g.:
@@ -29,11 +32,10 @@ services:
2932
# OPTILLM_RSTAR_C: 1.4
3033
# OPTILLM_N: 1
3134
# OPTILLM_RETURN_FULL_RESPONSE: false
32-
# OPTILLM_PORT: 8000
3335
restart: on-failure
3436
stop_grace_period: 2s
3537
healthcheck:
36-
test: ["CMD", "curl", "-f", "http://127.0.0.1:8000/health"]
38+
test: ["CMD", "curl", "-f", "http://127.0.0.1:${OPTILLM_PORT:-8000}/health"]
3739
interval: 30s
3840
timeout: 5s
3941
retries: 3

optillm/plugins/readurls_plugin.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def extract_urls(text: str) -> List[str]:
2525
def fetch_webpage_content(url: str, max_length: int = 100000) -> str:
2626
try:
2727
headers = {
28-
'User-Agent': 'optillm/0.0.20 (https://github.com/codelion/optillm)'
28+
'User-Agent': 'optillm/0.0.21 (https://github.com/codelion/optillm)'
2929
}
3030

3131
response = requests.get(url, headers=headers, timeout=10)

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
setup(
44
name="optillm",
5-
version="0.0.20",
5+
version="0.0.21",
66
packages=find_packages(),
77
py_modules=['optillm'],
88
package_data={

0 commit comments

Comments
 (0)