-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(deployment): Basic script and Dockerfiles
- Loading branch information
1 parent
69e0192
commit c557cc0
Showing
3 changed files
with
49 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"] |