-
Notifications
You must be signed in to change notification settings - Fork 117
Expand file tree
/
Copy pathDockerfile
More file actions
26 lines (20 loc) · 733 Bytes
/
Copy pathDockerfile
File metadata and controls
26 lines (20 loc) · 733 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
FROM python:3.11-slim AS builder
WORKDIR /app
COPY requirements.txt ./
RUN pip install --no-cache-dir -r requirements.txt
FROM python:3.11-slim
LABEL name="ExtAnalysis"
LABEL creator="Tuhinshubhra"
LABEL desc="Browser Extension Analysis Framework"
# Create a non-root user for security
RUN groupadd -r extanalysis && useradd -r -g extanalysis extanalysis
WORKDIR /app
COPY --from=builder /usr/local/lib/python3.11/site-packages /usr/local/lib/python3.11/site-packages
COPY --from=builder /usr/local/bin /usr/local/bin
COPY . .
# Change ownership of the app directory to the non-root user
RUN chown -R extanalysis:extanalysis /app
# Switch to non-root user
USER extanalysis
EXPOSE 13337
ENTRYPOINT ["python3", "extanalysis.py"]