Skip to content

Commit

Permalink
feat(deployment): Basic script and Dockerfiles
Browse files Browse the repository at this point in the history
  • Loading branch information
RezaRahemtola committed Nov 30, 2024
1 parent 69e0192 commit c557cc0
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 0 deletions.
17 changes: 17 additions & 0 deletions deployment/deploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash

# Setup
apt install docker.io -y

# Cleaning previous agent
rm -rf /root/libertai-agent
docker stop libertai-agent && docker rm $_

# Deploying the new agent
unzip /tmp/libertai-agent.zip -d /root/libertai-agent
wget https://TODO -o /tmp/libertai-agent.Dockerfile
docker build /root/libertai-agent \
-f /tmp/libertai-agent.Dockerfile \
-t libertai-agent \
--build-arg PYTHON_VERSION=$1
docker run -p 8000:8000 libertai-agent
15 changes: 15 additions & 0 deletions deployment/pip.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
ARG PYTHON_VERSION=3.11

FROM python:${PYTHON_VERSION}-slim

WORKDIR /app

COPY requirements.txt ./

RUN pip install --no-cache-dir -r requirements.txt;

COPY . .

EXPOSE 8000

CMD ["fastapi", "run", "src/main.py"]
17 changes: 17 additions & 0 deletions deployment/poetry.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
ARG PYTHON_VERSION=3.11

FROM python:${PYTHON_VERSION}-slim

WORKDIR /app

COPY pyproject.toml poetry.lock ./

RUN pip install --no-cache-dir poetry && \
poetry config virtualenvs.create false && \
poetry install --no-root --no-interaction --no-ansi;

COPY . .

EXPOSE 8000

CMD ["fastapi", "run", "src/main.py"]

0 comments on commit c557cc0

Please sign in to comment.