forked from lindsey98/Phishpedia
-
Notifications
You must be signed in to change notification settings - Fork 0
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 lindsey98#51 from Areedd/main
创建浏览器插件后端的Docker部署方式
- Loading branch information
Showing
3 changed files
with
60 additions
and
1 deletion.
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
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 |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# Use Ubuntu 20.04 as the base image | ||
FROM ubuntu:20.04 | ||
# Prevent interactive prompts during installation | ||
ARG DEBIAN_FRONTEND=noninteractive | ||
# Install Miniconda | ||
RUN apt-get update && apt-get install -y wget && \ | ||
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh && \ | ||
bash Miniconda3-latest-Linux-x86_64.sh -b -p /opt/miniconda && \ | ||
rm Miniconda3-latest-Linux-x86_64.sh | ||
# Add Miniconda to PATH | ||
ENV PATH="/opt/miniconda/bin:${PATH}" | ||
# Set working directory | ||
WORKDIR /workspace | ||
# Install git, unzip and other dependencies | ||
RUN apt-get install -y git unzip libgl1-mesa-glx libglib2.0-0 | ||
# Clone the Phishpedia project from GitHub into the container | ||
RUN git clone https://github.com/lindsey98/Phishpedia.git /workspace/Phishpedia | ||
# Change to the project directory and run setup.sh to configure the environment | ||
WORKDIR /workspace/Phishpedia | ||
# Install dos2unix | ||
RUN apt-get install -y dos2unix | ||
# Convert setup.sh to Unix format and RUN it | ||
RUN dos2unix setup.sh | ||
RUN chmod +x setup.sh | ||
RUN bash setup.sh || true | ||
# Install Flask and Flask-CORS | ||
RUN /opt/miniconda/envs/phishpedia/bin/pip install "werkzeug>=2.3.7" "flask>=2.3.3" "flask-cors>=4.0.0" | ||
# Ensure Conda is initialized and phishpedia environment is activated by default | ||
RUN echo "source /opt/miniconda/etc/profile.d/conda.sh && conda activate phishpedia" >> ~/.bashrc | ||
# Set the default command to execute when the container starts | ||
CMD ["bash", "-c", "source /opt/miniconda/etc/profile.d/conda.sh && conda activate phishpedia && cd /workspace/Phishpedia && python app.py"] | ||
# Expose the port that the application may use (assuming app.py uses port 5000) | ||
EXPOSE 5000 | ||
# Add health check | ||
HEALTHCHECK --interval=30s --timeout=30s --start-period=5s --retries=3 \ | ||
CMD curl -f http://localhost:5000/ || exit 1 |
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