-
Notifications
You must be signed in to change notification settings - Fork 29
/
Dockerfile
56 lines (40 loc) · 2.06 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
45
46
47
48
49
50
51
52
53
54
# Use the official Python image from the Docker Hub
FROM python:3.10-slim
# Set the working directory in the container
WORKDIR /app
# Install supervisor
RUN apt-get update && \
apt-get install -y supervisor && \
apt-get clean
# Copy both applications' requirements.txt and install dependencies
COPY server/Hate_Speech/requirements.txt /app/Hate_Speech/requirements.txt
COPY server/Click-Bait/requirements.txt /app/Click-Bait/requirements.txt
COPY server/Security-Header/requirements.txt /app/Security-Header/requirements.txt
COPY server/SSL/requirements.txt /app/SSL/requirements.txt
COPY server/Summarizer/requirements.txt /app/Summarizer/requirements.txt
COPY server/ReportAPI/requirements.txt /app/ReportAPI/requirements.txt
RUN pip install --no-cache-dir -r /app/Hate_Speech/requirements.txt && \
pip install --no-cache-dir -r /app/Click-Bait/requirements.txt && \
pip install --no-cache-dir -r /app/Security-Header/requirements.txt && \
pip install --no-cache-dir -r /app/SSL/requirements.txt && \
pip install --no-cache-dir -r /app/Summarizer/requirements.txt && \
pip install --no-cache-dir -r /app/ReportAPI/requirements.txt
RUN pip install --no-cache-dir -r /app/Hate_Speech/requirements.txt && \
pip install --no-cache-dir -r /app/Click-Bait/requirements.txt && \
pip install --no-cache-dir -r /app/Security-Header/requirements.txt && \
pip install --no-cache-dir -r /app/SSL/requirements.txt
# Copy both applications' code into the container
COPY server/Hate_Speech /app/Hate_Speech
COPY server/Click-Bait /app/Click-Bait
COPY server/Security-Header /app/Security-Header
COPY server/SSL /app/SSL
COPY server/Summarizer /app/Summarizer
COPY server/ReportAPI /app/ReportAPI
# Copy supervisor configuration file
COPY supervisor.conf /etc/supervisor/conf.d/supervisor.conf
# Expose ports for both servers
EXPOSE 5001 5002 5003 5004 5005 5006
# Start the supervisor daemon
CMD ["/usr/bin/supervisord"]
# docker build -t main .
# $ docker run -d -p 5001:5001 -p 5002:5002 -p 5003:5003 -p 5004:5004 -p 5005:5005 -p 5006:5006 --name instance main