-
Notifications
You must be signed in to change notification settings - Fork 50
Expand file tree
/
Copy pathDockerfile
More file actions
47 lines (36 loc) · 2.31 KB
/
Dockerfile
File metadata and controls
47 lines (36 loc) · 2.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
FROM nikolaik/python-nodejs:python3.11-nodejs18
WORKDIR /app
# install gh cli, nsenter (for host command execution), and other tools
RUN rm -rf /var/lib/apt/lists/* && \
apt-get update && apt-get install -y curl gnupg ca-certificates ripgrep util-linux && \
curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | gpg --dearmor -o /usr/share/keyrings/githubcli-archive-keyring.gpg && \
chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg && \
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | tee /etc/apt/sources.list.d/github-cli.list > /dev/null && \
apt-get update && \
apt-get install -y gh && \
rm -rf /var/lib/apt/lists/*
# curl -fsSL https://download.docker.com/linux/debian/gpg | gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg && \
# echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/debian bullseye stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null && \
# apt-get update && \
# apt-get install -y docker-ce-cli && \
# Install dependencies (cached unless requirements.txt changes)
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# docker buildx build --file Dockerfile --platform linux/amd64 --tag kody06/llamabot:0.2.19-saas --push .
# UNCOMMENT THIS LINE for SAAS builds.
# RUN playwright install --with-deps chromium
# Copy the rest of the app
COPY . .
# Change working directory to where the app code is located
WORKDIR /app/app
# Environment variables (all optional)
# DB_URI: PostgreSQL connection string (falls back to MemorySaver if not provided)
# Example: postgresql://user:password@host:port/database
ENV DB_URI=""
# Set PYTHONPATH so Python can find the app module regardless of working directory
ENV PYTHONPATH="/app:$PYTHONPATH"
# Expose port
EXPOSE 8000
CMD ["bash", "-c", "if [ ! -z \"$DB_URI\" ]; then python init_pg_checkpointer.py; fi && uvicorn main:app --host 0.0.0.0 --port 8000 --ws-max-size 157286400"]
# These commands document how to build the Docker image quickly and deploy to dockerhub
# docker buildx build --file Dockerfile --platform linux/amd64,linux/arm64 --tag kody06/llamabot:0.4.0c --push .