-
-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
104 additions
and
699 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 |
---|---|---|
@@ -1,18 +1,34 @@ | ||
FROM python:3.9 | ||
FROM python:3.9-slim as base | ||
|
||
WORKDIR /app | ||
# Set environment variables | ||
ENV PYTHONDONTWRITEBYTECODE 1 | ||
ENV PYTHONUNBUFFERED 1 | ||
ENV POETRY_VERSION 1.8.3 | ||
ENV POETRY_HOME "/opt/poetry" | ||
ENV POETRY_NO_INTERACTION 1 | ||
ENV PATH "$POETRY_HOME/bin:$PATH" | ||
|
||
COPY ./main.py /app/main.py | ||
# Install system dependencies | ||
RUN apt-get update \ | ||
&& apt-get install -y --no-install-recommends curl \ | ||
&& apt-get clean \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
COPY ./routers /app/routers | ||
COPY ./static /app/static | ||
# Install Poetry - respects $POETRY_VERSION & $POETRY_HOME | ||
RUN curl -sSL https://install.python-poetry.org | python3 - | ||
|
||
RUN pip install poetry | ||
RUN poetry config virtualenvs.create false | ||
|
||
COPY pyproject.toml poetry.lock ./ | ||
RUN poetry install --only main | ||
# Copy only requirements to cache them in docker layer | ||
WORKDIR /app | ||
COPY poetry.lock pyproject.toml /app/ | ||
|
||
# Project initialization: | ||
RUN poetry config virtualenvs.create false | ||
RUN poetry install --no-interaction | ||
|
||
EXPOSE 8000 | ||
COPY main.py /app/ | ||
COPY routers /app/routers/ | ||
COPY static /app/static/ | ||
|
||
CMD ["python", "main.py"] | ||
# Command to run the application | ||
CMD ["poetry", "run", "python", "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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
echo "Deploying Server..." | ||
echo "Deploying to Server..." | ||
|
||
git pull origin main | ||
|
||
|
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 |
---|---|---|
@@ -1,2 +1 @@ | ||
sudo docker system prune -f | ||
sudo docker compose -f docker-compose.yaml up --build --force-recreate -d |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
This file was deleted.
Oops, something went wrong.
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
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
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
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
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
Oops, something went wrong.