forked from itsOwen/CyberScraper-2077
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
44 lines (34 loc) · 1.03 KB
/
Dockerfile
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
32
33
34
35
36
37
38
39
40
41
42
43
44
# Use the specified Python image
FROM python:3.8.19-slim-bullseye
# Set the working directory in the container
WORKDIR /app
# Install system dependencies including Git
RUN apt-get update && apt-get install -y \
wget \
gnupg \
git \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# Cyberscraper repo :)
RUN git clone https://github.com/itsOwen/CyberScraper-2077.git .
# Create and activate a virtual environment
RUN python -m venv venv
ENV PATH="/app/venv/bin:$PATH"
# Install Python dependencies
RUN pip install --no-cache-dir -r requirements.txt
# Install playwright and its browser
RUN pip install playwright requests
RUN playwright install chromium
RUN playwright install-deps
# Expose port 8501 for Streamlit
EXPOSE 8501
# Create a shell script to run the application
RUN echo '#!/bin/bash\n\
if [ ! -z "$OPENAI_API_KEY" ]; then\n\
export OPENAI_API_KEY=$OPENAI_API_KEY\n\
fi\n\
streamlit run main.py\n\
' > /app/run.sh
RUN chmod +x /app/run.sh
# Set the entrypoint to the shell script
ENTRYPOINT ["/app/run.sh"]