-
Notifications
You must be signed in to change notification settings - Fork 0
/
development.Dockerfile
39 lines (27 loc) · 1.06 KB
/
development.Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# Python base image
FROM python:3.10
LABEL maintainer="Lewis Munyi"
LABEL environment="dev"
# https://stackoverflow.com/questions/59812009/what-is-the-use-of-pythonunbuffered-in-docker-file
ENV PYTHONUNBUFFERED=1
ENV POETRY_VERSION=1.7.1
# Set the working directory inside the container
WORKDIR /api
# Copy the application code to the working directory
COPY . .
# Uncomment the following lines if you are using Pip not poetry
# Copy the requirements file to the working directory
#COPY requirements.txt .
# Install the Python dependencies
#RUN pip install -r requirements.txt
# Install poetry & packages
RUN curl -sSL https://install.python-poetry.org | python3 -
# Update path for poetry
ENV PATH="${PATH}:/root/.local/bin"
# https://python-poetry.org/docs/configuration/#virtualenvscreate
RUN poetry config virtualenvs.create false
RUN poetry install --no-root --no-interaction
# Expose the port on which the application will run
EXPOSE 8000
# Run the FastAPI application using uvicorn server
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000", "--reload"]