-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adds dockerfile and docker compose #1
Open
hllustosa
wants to merge
6
commits into
vintasoftware:main
Choose a base branch
from
hllustosa:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
a8e9c73
Adds dockerfile and docker compose
hllustosa 151225a
Bumps poetry version
hllustosa a97a5c0
Makes dockerfile ports configurable
hllustosa 6bca0d2
Adds dockerignore
hllustosa 021b357
Merge branch 'adds-dockerization'
hllustosa d073745
Fixes configurable port entry point
hllustosa File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ | ||
*.db |
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,8 @@ | ||
docker_build: | ||
@docker compose up --no-start slackbot-ai | ||
|
||
docker_start_all: docker_build | ||
@docker compose start slackbot-ai | ||
|
||
docker_stop_all: | ||
@docker compose stop | ||
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 @@ | ||
services: | ||
slackbot-ai: | ||
container_name: slack-bot-ai | ||
image: slackbot-ai:latest | ||
build: . | ||
ports: | ||
- "${PORT:-7999}:${PORT:-7999}" | ||
- "${DEBUG_PORT:-3000}:${DEBUG_PORT:-3000}" | ||
env_file: .env | ||
tty: true | ||
stdin_open: true | ||
volumes: | ||
- type: bind | ||
source: . | ||
target: /app/ |
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,31 @@ | ||
FROM python:3.10-slim AS base | ||
|
||
ENV LANG C.UTF-8 | ||
ENV PYTHONUNBUFFERED 1 | ||
|
||
RUN DEBIAN_FRONTEND=noninteractive apt-get update && apt-get install -y --no-install-recommends \ | ||
build-essential \ | ||
tzdata \ | ||
git \ | ||
libatlas-base-dev\ | ||
&& \ | ||
apt-get clean && \ | ||
rm -rf /var/lib/apt/lists/* && \ | ||
pip install --no-cache-dir poetry==1.8.3 setuptools && poetry config virtualenvs.create false | ||
|
||
|
||
RUN pip install --upgrade pip && pip install --no-cache-dir poetry gunicorn uvicorn && poetry config virtualenvs.create false | ||
|
||
|
||
FROM base AS install | ||
|
||
WORKDIR /app | ||
COPY pyproject.toml poetry.lock /app/ | ||
RUN poetry install --no-dev | ||
|
||
FROM install AS runtime | ||
COPY . /app/ | ||
|
||
ENV PORT=7999 | ||
|
||
ENTRYPOINT ["sh", "-c", "uvicorn project.api:app --host 0.0.0.0 --port $PORT --reload"] |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could not find a place to hook this on, but maybe add *.db into .dockerignore like it is on .gitignore? the reasoning for this is that it's mapped as a volume, but building and pushing an image from your machine is going to send the sqlite db along the image.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Created a dockerignore with the .db exclusion to be on the safe side.