Skip to content

Commit

Permalink
Update Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
antoinebou12 authored Jun 15, 2023
1 parent 88a72d3 commit 1b743be
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
# Python fastapi app using poetry

FROM tiangolo/uvicorn-gunicorn-fastapi:python3.10

ARG PYTHONUNBUFFERED=1
ENV PORT=8080
ARG HOST=0.0.0.0

ENV HOST=0.0.0.0

# Stage 1 - Build

Expand All @@ -19,7 +16,14 @@ WORKDIR /app
COPY . .

# Install dependencies
RUN poetry install
RUN poetry config virtualenvs.create false && \
poetry install --no-interaction --no-ansi

# Build the app
RUN poetry build

# Expose the port
EXPOSE $PORT

# Run app
CMD uvicorn app.app:app --port $PORT --host=$HOST
# Run the app
CMD ["poetry", "run", "uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8080"]

0 comments on commit 1b743be

Please sign in to comment.