-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #287 from perfectly-preserved-pie/dev
New lists: Big ass change
- Loading branch information
Showing
12 changed files
with
818 additions
and
519 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,7 @@ __pycache__/larentals.cpython-310.pyc | |
*.csv | ||
*.pyc | ||
*.xlsx | ||
.venv/ | ||
env | ||
hdf | ||
larentals-checkpoint.py | ||
|
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,22 +1,31 @@ | ||
FROM python:3.11-slim | ||
|
||
COPY requirements.txt . | ||
# Set the working directory | ||
WORKDIR /app | ||
|
||
# Install curl | ||
RUN apt-get update && apt-get install -y curl | ||
# Switch to root user to install dependencies | ||
USER root | ||
|
||
# Using uv to install packages because it's fast as fuck boiiii | ||
# https://www.youtube.com/watch?v=6E7ZGCfruaw | ||
# https://ryxcommar.com/2024/02/15/how-to-cut-your-python-docker-builds-in-half-with-uv/ | ||
ADD --chmod=655 https://astral.sh/uv/install.sh /install.sh | ||
RUN /install.sh && rm /install.sh | ||
RUN /root/.cargo/bin/uv pip install --system --no-cache -r requirements.txt | ||
# Create the nonroot user and set permissions | ||
RUN adduser --disabled-password --gecos "" nonroot && chown -R nonroot /app | ||
|
||
COPY . ./ | ||
# Copy everything into the working directory | ||
COPY . /app | ||
|
||
# Copy uv binary directly from the UV container image | ||
COPY --from=ghcr.io/astral-sh/uv:latest /uv /bin/uv | ||
|
||
# Install dependencies directly into the system environment using uv | ||
RUN uv pip install --system --no-cache-dir -r requirements.txt | ||
|
||
# Switch back to non-root user | ||
USER nonroot | ||
|
||
# Install curl (if needed, uncomment this line) | ||
# RUN apt-get update && apt-get install -y curl | ||
|
||
# Run the app using gunicorn. | ||
# Expose the port gunicorn is listening on (80). | ||
# Set the number of workers to 10. | ||
# Preload the app to avoid the overhead of loading the app for each worker. See https://www.joelsleppy.com/blog/gunicorn-application-preloading/ | ||
# Set the app to be the server variable in app.py. | ||
CMD ["gunicorn", "-b", "0.0.0.0:80", "-k", "gevent", "--workers=10", "--preload", "app:server"] | ||
# Preload the app to avoid the overhead of loading the app for each worker. | ||
CMD ["gunicorn", "-b", "0.0.0.0:80", "-k", "gevent", "--workers=10", "--preload", "app:server"] |
Binary file not shown.
Binary file not shown.
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
Oops, something went wrong.