-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated .env by adding a new line! Updated blacklist.py to use the st…
…ored REDIS_HOST environment variable to access the host correctly for running locally vs in docker! Updated run.py by changing the host to run on 0.0.0.0 instead of debug mode! Updated setupEnv.py by adding a function to check if running in docker to determine whether to run redis since redis is in its own docker container! Created Dockerfile.backend to configure the docker image to install and setup the backend! Created Dockerfile.frontend to configure the docker image to install and setup the frontend! Created compose.yml file with the logic to run the three services in docker containers!
- Loading branch information
1 parent
26ab50f
commit 14234e2
Showing
7 changed files
with
120 additions
and
24 deletions.
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
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
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,28 @@ | ||
# Use Python 3.12 slim image as base | ||
FROM python:3.12-slim-bullseye | ||
|
||
# Install necessary dependencies | ||
RUN apt-get update && apt-get install -y cron | ||
|
||
# Set the working directory | ||
WORKDIR /app | ||
|
||
# Copy only requirements and setup scripts first to leverage Docker cache | ||
COPY BackEndFlask/requirements.txt BackEndFlask/setupEnv.py /app/ | ||
|
||
# Install Python dependencies | ||
RUN pip install --no-cache-dir --upgrade pip \ | ||
&& pip install --no-cache-dir -r requirements.txt | ||
|
||
# Copy the rest of the backend code | ||
COPY BackEndFlask/ /app/ | ||
|
||
# Initialize the Backend environment | ||
RUN python setupEnv.py -id | ||
|
||
# Expose the Backend port | ||
EXPOSE 5000 | ||
|
||
# Start the Flask server | ||
CMD ["python", "setupEnv.py", "-s"] | ||
|
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,19 @@ | ||
# Use a valid Node.js version as base | ||
FROM node:20 | ||
|
||
# Set the working directory | ||
WORKDIR /app | ||
|
||
# Copy package files and install dependencies | ||
COPY FrontEndReact/package*.json /app/ | ||
RUN npm install | ||
|
||
# Copy the rest of the frontend code | ||
COPY FrontEndReact/ /app/ | ||
|
||
# Expose the Frontend port | ||
EXPOSE 3000 | ||
|
||
# Start the Frontend server | ||
CMD ["npm", "start"] | ||
|
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 @@ | ||
services: | ||
backend: | ||
build: | ||
context: . | ||
dockerfile: Dockerfile.backend | ||
ports: | ||
- "5001:5000" | ||
depends_on: | ||
- redis | ||
networks: | ||
- app-network | ||
environment: | ||
- REDIS_HOST=redis | ||
|
||
redis: | ||
image: redis:7.2.4 | ||
ports: | ||
- "6379:6379" | ||
networks: | ||
- app-network | ||
|
||
frontend: | ||
build: | ||
context: . | ||
dockerfile: Dockerfile.frontend | ||
ports: | ||
- "3000:3000" | ||
environment: | ||
- REACT_APP_API_URL=http://localhost:5001/api | ||
networks: | ||
- app-network | ||
|
||
networks: | ||
app-network: | ||
driver: bridge | ||
|