Skip to content

Commit 4603012

Browse files
author
John Dutchover
committed
refactor Dockerfile
1 parent 5054e2a commit 4603012

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

app/Dockerfile

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,18 @@
33
FROM python:3.11 as base
44

55
# Set the working directory in the Docker image
6-
WORKDIR /usr/src/app
6+
WORKDIR /app
77

8-
# Copy the entire app directory into the container at /usr/src/app
9-
COPY app/requirements/requirements.txt /usr/src/app
8+
# Copy the entire app directory into the container at /app
9+
COPY app/requirements/requirements.txt /app
1010
# use trailing . to include hidden files
11-
COPY app/. /usr/src/app
11+
COPY app/. /app
1212

1313
# Create and activate a virtual environment
14-
RUN python -m venv venv
14+
RUN python3 -m venv venv
1515

1616
# Activate the virtual environment and install dependencies
17-
RUN . venv/bin/activate && pip install --no-cache-dir --upgrade -r requirements.txt
17+
RUN pip install --no-cache-dir --upgrade -r requirements.txt
1818

1919
# Make port 8000 available to the world outside this container
2020
EXPOSE 8000
@@ -29,4 +29,4 @@ HEALTHCHECK --interval=5m --timeout=3s \
2929
CMD curl --fail http://localhost:8000/docs || exit 1
3030

3131
# Set entrypoint for FastAPI when the container launches
32-
ENTRYPOINT ["python", "main.py"]
32+
CMD ["python", "./main.py"]

0 commit comments

Comments
 (0)