-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change server dockerfile to adjust to folder structure
- Loading branch information
David Mang
committed
Sep 1, 2024
1 parent
739f64e
commit ed9ff70
Showing
4 changed files
with
21 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,25 @@ | ||
# Use Python slim image | ||
FROM python:3.12.4-slim-bookworm | ||
|
||
# Set the working directory inside the Docker image | ||
WORKDIR /server | ||
|
||
COPY ../../server . | ||
# Copy only the requirements first to leverage caching | ||
COPY ../../server/requirements.txt . | ||
|
||
# Create and activate the virtual environment, then install dependencies | ||
RUN python3 -m venv /opt/venv && \ | ||
/opt/venv/bin/pip install --upgrade pip && \ | ||
/opt/venv/bin/pip install -r requirements.txt --no-cache-dir && \ | ||
chmod +x /server/entrypoint.sh | ||
/opt/venv/bin/pip install -r requirements.txt --no-cache-dir | ||
|
||
# Copy the rest of the server code into the Docker image | ||
COPY ../../server . | ||
|
||
# Ensure entrypoint script has execute permissions | ||
RUN chmod +x /server/entrypoint.sh | ||
|
||
# Expose the application port | ||
EXPOSE 8000 | ||
|
||
CMD [ "/server/entrypoint.sh" ] | ||
# Run the entrypoint script | ||
CMD [ "/server/entrypoint.sh" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters