-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7c32b7a
commit cde732c
Showing
4 changed files
with
67 additions
and
33 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 |
---|---|---|
@@ -1,13 +1,33 @@ | ||
FROM python:3.11-slim | ||
FROM python:3.12-slim | ||
|
||
RUN apt-get update && apt-get install -y \ | ||
tree \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
# Set environment variables | ||
ENV PYTHONUNBUFFERED=1 \ | ||
PYTHONDONTWRITEBYTECODE=1 \ | ||
PIP_NO_CACHE_DIR=1 | ||
|
||
# Create non-root user | ||
RUN useradd -m -s /bin/bash user | ||
|
||
# Install system dependencies | ||
RUN apt-get update && apt-get install -y --no-install-recommends \ | ||
tree \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
WORKDIR /app | ||
|
||
# Copy all necessary files for package installation | ||
COPY pyproject.toml README.md ./ | ||
|
||
# Copy the package source | ||
COPY repo_to_text ./repo_to_text | ||
|
||
# Install the package | ||
RUN pip install --no-cache-dir -e . | ||
|
||
# Copy remaining files | ||
COPY . . | ||
RUN pip install -e . && pip install pyperclip | ||
|
||
# Set default user | ||
USER user | ||
|
||
ENTRYPOINT ["repo-to-text"] |
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,10 +1,13 @@ | ||
services: | ||
repo-to-text: | ||
build: . | ||
build: | ||
context: . | ||
dockerfile: Dockerfile | ||
volumes: | ||
- ${HOME:-/home/user}:/home/user | ||
working_dir: /home/user | ||
environment: | ||
- HOME=/home/user | ||
user: "${UID:-1000}:${GID:-1000}" | ||
init: true | ||
entrypoint: ["/bin/bash"] |