-
Notifications
You must be signed in to change notification settings - Fork 80
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
Feat: Docker setup #208
Open
epicadk
wants to merge
12
commits into
anitab-org:develop
Choose a base branch
from
epicadk:docker_setup
base: develop
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
Feat: Docker setup #208
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
4bd899c
docker
epicadk 0013528
Feat: Docker for setup(2)
epicadk 23c87da
added config
epicadk b55c0ed
Docker setup(4)
epicadk ab97ce8
Docker setup instructions
epicadk ce69371
Merge branch 'develop' into docker_setup
epicadk ae9dff1
Merge branch 'docker_setup' of https://github.com/epicadk/bridge-in-t…
epicadk 9e2411f
Add more commands to Makefile
epicadk b78fbc8
minor bug fix
epicadk bb10bd8
minor bug fix(2)
epicadk 16a96a0
minor bug fix(3)
epicadk 9a08d42
minor bug fix(4)
epicadk 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,9 @@ | ||
LICENSE | ||
README.md | ||
__pycache__ | ||
dockerfile | ||
docs | ||
venv | ||
.git | ||
.vscode | ||
.github |
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,27 @@ | ||
BridgeInTech Development Setup Instructions (Docker) | ||
|
||
Before you start, you need to have the following installed: | ||
- [Docker-desktop](https://www.docker.com/products/docker-desktop) | ||
|
||
If you have these already installed, you are ready to start. | ||
|
||
## 1st, Fork, Clone, and Remote | ||
1. Follow the instruction on the [Fork, Clone, and Remote](https://github.com/anitab-org/bridge-in-tech-backend/wiki/Fork,-Clone-&-Remote) page for this step. | ||
|
||
<!--This can be removed once the changes to the BIT branch have been merged--> | ||
## 2nd, Clone mentorship-backend for BIT | ||
1.Follow the instruction on the mentorship system [Fork, Clone, and Remote](https://github.com/anitab-org/mentorship-backend/wiki/Fork,-Clone-&-Remote) page for this step. Make sure the two projects are cloned in the same directory. | ||
|
||
## 3rd, Create .env file from .env.template | ||
|
||
You can ignore all the environment variables below flask_app(included) as they have already been set up in docker. <!--TODO add guide to environment variables--> | ||
|
||
## 4th running the app locally | ||
Run the command `docker-compose up`.If you can use Makefiles then you can also run `make docker_dev`. If this is your first time it may take a while to download the images and get everything set up properly. Once this is complete you should be able to see the app running on http://localhost:5000 and the mentorship system running on http://localhost:4000. You can also connect to the Postgres server using `port 5432`. | ||
|
||
## 5th Running test cases | ||
Run the command `docker-compose -f docker-compose.test.yml up --exit-code-from bit` to run the test cases. If you can use Makefiles then you can also run `make docker_test`. Linux and MacOS support make out of the box, but you can also use makefiles on windows by installing MinGW. | ||
|
||
|
||
|
||
|
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,18 @@ | ||
FROM python:latest | ||
COPY ./requirements.txt /dockerBuild/requirements.txt | ||
WORKDIR /dockerBuild | ||
RUN pip install --no-cache-dir -r requirements.txt | ||
COPY . /dockerBuild | ||
ENV DB_TYPE=postgresql | ||
ENV DB_USERNAME=postgres | ||
ENV DB_PASSWORD=postgres | ||
ENV DB_ENDPOINT=postgres:5432 | ||
ENV DB_TEST_ENDPOINT=test_postgres:5432 | ||
ENV DB_NAME=bit_schema | ||
ENV DB_TEST_NAME=bit_schema_test | ||
ENV POSTGRES_HOST=postgres | ||
ENV POSTGRES_PORT=5432 | ||
ENV MS_URL=http://MS:5000 | ||
ENV FLASK_APP=run.py | ||
ENTRYPOINT ["make"] | ||
CMD ["docker_host_dev"] |
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,14 @@ | ||
dev: | ||
python run.py | ||
docker_host_dev: | ||
flask run --host 0.0.0.0 | ||
python_tests: | ||
python -m unittest discover tests | ||
docker_test: | ||
docker-compose -f docker-compose.test.yml up --build --exit-code-from bit --remove-orphans | ||
docker_dev: | ||
docker-compose up --build --remove-orphans | ||
|
||
|
||
|
||
|
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.
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.
Do we need this hard-coded string still?