-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #12 from UpMortem/dockerize-py
- Loading branch information
Showing
25 changed files
with
58 additions
and
5,130 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 |
---|---|---|
|
@@ -4,3 +4,8 @@ tslint.json | |
.env | ||
Dockerfile | ||
dev-env-setup/* | ||
*.pyc | ||
*.pyo | ||
*.pyd | ||
__pycache__ | ||
.pytest_cache |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,13 @@ | ||
FROM node:19.4.0-bullseye-slim | ||
|
||
COPY ./* /app/ | ||
FROM python:3.10-slim | ||
ENV PYTHONUNBUFFERED True | ||
|
||
WORKDIR /app | ||
|
||
RUN npm install | ||
RUN npm run build | ||
COPY requirements.txt . | ||
RUN pip install --no-cache-dir -r requirements.txt | ||
|
||
COPY ./src ./src | ||
|
||
CMD ["npm", "start"] | ||
CMD exec gunicorn --bind :$PORT --workers 1 --threads 8 --timeout 0 index:flask_app --chdir /app/src | ||
|
||
EXPOSE 8080 |
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,11 +1,21 @@ | ||
# slack-bot | ||
|
||
## Setup | ||
## Setup for dev | ||
|
||
- Set variables in .env file | ||
- Have venv installed | ||
- To enable the virtual environment run `source venv/bin/activate` on Linux/MacOS and `venv\Scripts\activate` on Windows | ||
- Run `pip install -r "requirements.txt"` to install dependencies | ||
- Run `flask --debug run` to start the dev server | ||
- Have venv installed `python3 -m pip install virtualenv` and create a venv at the root of your project using `python3 -m virtualenv -p python3 myvenv` | ||
- To enable the virtual environment run `source myvenv/bin/activate` on Linux/MacOS and `myvenv\Scripts\activate` on Windows - this opens up a terminal into the virtual environment. | ||
- verify your python is isolated by typing `where python` in the above terminal | ||
- Run `pip install -r "requirements.txt"` to install dependencies in the same terminal | ||
- Run `flask --debug run` to start the dev server in the same terminal | ||
|
||
If you use the --debug flag when running flask, the application will rebuild whenever the source code changes. | ||
|
||
## release | ||
|
||
- Setup a new release tag in github for the revision you want to release | ||
- Got to google cloud console | ||
- Click on the instance you want to release to (or create new deployment through cloud build) | ||
- Click on `EDIT & DEPLOY NEW REVISION` | ||
- Update the tag version in the `Container image URL` field. | ||
- Scroll down and click deploy |
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.
Oops, something went wrong.