forked from hngprojects/hng_boilerplate_python_fastapi_web
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
25 lines (19 loc) · 664 Bytes
/
Dockerfile
File metadata and controls
25 lines (19 loc) · 664 Bytes
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
# Use an official Python runtime as the base image
FROM python:3.12-alpine
# Set environment variables
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1
ENV PYTHONPATH=/app
# Set the working directory in the container
WORKDIR /app
# Install system dependencies
RUN apk add --no-cache curl
#copy the requirements.txt file and install with pip
COPY ./requirements.txt /app/requirements.txt
RUN pip install --no-cache-dir --upgrade -r requirements.txt
# Copy the rest of the backend files
COPY . /app/
# Expose the port the app runs on
EXPOSE 7001
# Command to run the application
CMD ["/bin/sh", "-c", "uvicorn main:app --host 0.0.0.0 --port 7001 --reload"]