-
Notifications
You must be signed in to change notification settings - Fork 344
Expand file tree
/
Copy pathDockerfile
More file actions
31 lines (20 loc) · 742 Bytes
/
Dockerfile
File metadata and controls
31 lines (20 loc) · 742 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
26
27
28
29
30
31
FROM python:3.13.2-bookworm
RUN apt-get update -y && apt-get upgrade -y
RUN pip3 install --upgrade pip
RUN pip3 install uv
COPY ./requirements.txt /python-seo-analyzer/
RUN uv pip install --system --verbose --requirement /python-seo-analyzer/requirements.txt
RUN uv cache clean --verbose
COPY . /python-seo-analyzer
# Create a non-root user
RUN groupadd -r appgroup && useradd --no-log-init -r -g appgroup appuser
# Set ownership of the app directory
RUN chown -R appuser:appgroup /python-seo-analyzer
# Switch back to root to install the package system-wide
USER root
RUN python3 -m pip install /python-seo-analyzer
# Switch back to the non-root user
USER appuser
WORKDIR /app
ENTRYPOINT ["python-seo-analyzer"]
CMD ["--version"]