Skip to content

Conversation

@GabrielDS
Copy link
Contributor

@GabrielDS GabrielDS commented Apr 2, 2020

  • Adds Dockerfile for image build.
  • Adds dockercompose to facilitate workflow.
  • Adds dockerignore for futures adjusts.
  • Adds "--host" parameter on uvicorn to fix networking problem when run inside container.

Notes:

The pipenv is slow down the image build, also, increase ~37mb of image's size but this pull request is just to add docker flow for development enviroment. To run on production enviroments safety, we will need to do somes ajusts that could change the project a little bit.

The app waits a environment variable called "PORT" but, even without it, i can run the api using the port 8000 (a little bit strange).

#252

@GabrielDS GabrielDS force-pushed the enhancement_issue_251 branch from 28c43c8 to b7be144 Compare April 2, 2020 01:14
build: .
image: expdev07/coronavirus-tracker-api:2.0
restart: always
command: pipenv --python 3.7 run dev
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We shouldn't be running the dev version with the "reload" flag in the container.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

Pipfile Outdated

[scripts]
dev = "uvicorn app.main:APP --reload"
dev = "uvicorn --host 0.0.0.0 app.main:APP --reload"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You shouldn't be changing this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

@Kilo59 Kilo59 linked an issue Apr 2, 2020 that may be closed by this pull request
@GabrielDS GabrielDS force-pushed the enhancement_issue_251 branch from b7be144 to d4d7d2d Compare April 2, 2020 12:04
@GabrielDS GabrielDS requested a review from Kilo59 April 2, 2020 12:15
@Kilo59 Kilo59 added dev Issue related to ease of development and code smells enhancement New feature or request labels Apr 3, 2020
Dockerfile Outdated

# INSTALL DEPENDENCIES
RUN pip install pipenv
RUN pipenv install --system --deploy --dev
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should install from the requirements files once this goes in. #245

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Which requirements file? requirements-dev.txt or requirements.txt?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just requirements.txt

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!!

Copy link
Collaborator

@Kilo59 Kilo59 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use requirements.txt

@GabrielDS GabrielDS force-pushed the enhancement_issue_251 branch from d4d7d2d to 5b0631e Compare April 7, 2020 11:04
@GabrielDS GabrielDS force-pushed the enhancement_issue_251 branch from 5b0631e to 4ffe433 Compare April 7, 2020 11:10
@GabrielDS GabrielDS requested a review from Kilo59 April 7, 2020 11:12
@Kilo59 Kilo59 merged commit 5b01979 into ExpDev07:master Apr 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dev Issue related to ease of development and code smells enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add docker compatibility

2 participants