Skip to content

Commit

Permalink
Merge pull request #67 from unipoll/development
Browse files Browse the repository at this point in the history
Renamed database and updated Dockerfile
  • Loading branch information
mike-pisman authored Oct 2, 2023
2 parents b0334fb + 839dfdf commit 3513d97
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 7 deletions.
22 changes: 17 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,23 @@
FROM python:3.11
FROM python:3.11-alpine

WORKDIR /unipoll-api

COPY ./requirements.txt /unipoll-api/requirements.txt
COPY ./pyproject.toml /unipoll-api/pyproject.toml

RUN pip install --no-cache-dir -r /unipoll-api/requirements.txt
COPY ./src/ /unipoll-api/src/

COPY ./src/ /unipoll-api/
RUN pip install build

CMD ["uvicorn", "unipoll_api.app:app", "--host", "0.0.0.0", "--port", "8000"]
RUN python -m build

FROM python:3.11-alpine

WORKDIR /unipoll-api

COPY --from=0 /unipoll-api/dist/*.tar.gz .

RUN tar -xf unipoll-api-*.tar.gz --strip-components=1

RUN pip install .

ENTRYPOINT [ "unipoll-api" ]
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ max-line-length = 120

[tool.pytest.ini_options]
pythonpath = ["src"]
testpaths = ["tests"]
addopts = "--cov --cov-report lcov"
asyncio_mode="auto"
filterwarnings = [
Expand Down
5 changes: 3 additions & 2 deletions src/unipoll_api/mongo_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@
settings = get_settings()

client = motor.motor_asyncio.AsyncIOMotorClient(
settings.mongodb_url, uuidRepresentation="standard"
host=settings.mongodb_url,
uuidRepresentation="standard",
)
mainDB = client.app

mainDB = client["unipoll-api"]

documentModels = [
Documents.AccessToken,
Expand Down

0 comments on commit 3513d97

Please sign in to comment.