Skip to content

Commit

Permalink
updated app port to 8081 for avoiding collision with frontend-cypress
Browse files Browse the repository at this point in the history
  • Loading branch information
borolepratik committed Jan 10, 2024
1 parent bea4e60 commit 2ff030f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions Dockerfile.dev
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ RUN pip install --no-cache-dir poetry
RUN poetry config virtualenvs.create false \
&& poetry install --no-interaction --no-ansi --no-root

# Make port 8080 available to the world outside this container
EXPOSE 8080
# Make port 8081 available to the world outside this container
EXPOSE 8081

# Healthcheck
HEALTHCHECK --interval=5m --timeout=3s \
CMD curl -f http://localhost/health || exit 1

# Run the uvicorn command, telling it to use the app object imported from app.main.
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8080", "--reload"]
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8081", "--reload"]

# CMD ["uvicorn", "app.main:app", "--proxy-headers", "--host", "0.0.0.0", "--port", "8080" "--reload"]
# CMD ["uvicorn", "app.main:app", "--proxy-headers", "--host", "0.0.0.0", "--port", "8081" "--reload"]
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ poetry install --no-root
- Execute the `/Scripts/Activate` script from the virtual environment located [here](https://python-poetry.org/docs/configuration/#cache-directory)

- Run `python run.py` to start the server.
- Open your browser at `http://127.0.0.1/8080`.
- Open your browser at `http://127.0.0.1/8081`.

### Docker

Expand All @@ -62,15 +62,15 @@ poetry install --no-root
**Note**: The first build will take about 10 minutes. Please be patient. Subsequent builds should be quicker (given that the image has not been prunes).
- Run container
```sh
docker run --detach --name backend-dev-container --publish 8080:8080 backend-dev
docker run --detach --name backend-dev-container --publish 8081:8081 backend-dev
```
- Open your browser at http://127.0.0.1/8080.
- Open your browser at http://127.0.0.1/8081.
- For other docker commands, see [useful_commands.md](./useful_commands.md)

### Interactive API docs

- Once the server is running, open your browser at `http://127.0.0.1:8080/docs`.
- Alternate docs can be found at `http://127.0.0.1:8080/redoc`, provided by [redoc](https://github.com/Redocly/redoc).
- Once the server is running, open your browser at `http://127.0.0.1:8081/docs`.
- Alternate docs can be found at `http://127.0.0.1:8081/redoc`, provided by [redoc](https://github.com/Redocly/redoc).

### Interactive Jupyter notebook

Expand Down
2 changes: 1 addition & 1 deletion run.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

def start_server():
uvicorn.run(
"app.main:app", host="127.0.0.1", port=8080, reload=True, log_level="info"
"app.main:app", host="127.0.0.1", port=8081, reload=True, log_level="info"
)


Expand Down

0 comments on commit 2ff030f

Please sign in to comment.