diff --git a/Application/backend/backend/app.log b/Application/backend/app.log similarity index 100% rename from Application/backend/backend/app.log rename to Application/backend/app.log diff --git a/Application/backend/backend/.env b/Application/backend/backend/.env deleted file mode 100644 index e3d79b39d6f1f7b617270b4429dcadea414ce159..0000000000000000000000000000000000000000 --- a/Application/backend/backend/.env +++ /dev/null @@ -1,4 +0,0 @@ -SWTICH_ACCESS_KEY_ID=4406dbe746a24614a9bc8f7ec864e59f -SWITCH_SECRET_ACCESS_KEY=cec6e60954b24a51923fe5aaea9fbb3b -SWTICH_ENDPOINT_URL=https://os.zhdk.cloud.switch.ch -S3_BUCKET_NAME=cloud-bach-proj \ No newline at end of file diff --git a/Application/backend/backend/main.py b/Application/backend/main.py similarity index 100% rename from Application/backend/backend/main.py rename to Application/backend/main.py diff --git a/Application/backend/requirements.txt b/Application/backend/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..e7c8192bfba07505e05c377ffcb98134691ec7de --- /dev/null +++ b/Application/backend/requirements.txt @@ -0,0 +1,4 @@ +flask +flask-cors +boto3 +python-dotenv \ No newline at end of file diff --git a/Application/frontend/frontend/main.py b/Application/frontend/main.py similarity index 100% rename from Application/frontend/frontend/main.py rename to Application/frontend/main.py diff --git a/Application/frontend/requirements.txt b/Application/frontend/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..4e207882d40ed8554da7d45c94cf60a4a5a58f68 --- /dev/null +++ b/Application/frontend/requirements.txt @@ -0,0 +1,2 @@ +Flask==2.0.1 +Werkzeug==2.0.1 \ No newline at end of file diff --git a/Application/frontend/frontend/views/dashboard.html b/Application/frontend/views/dashboard.html similarity index 100% rename from Application/frontend/frontend/views/dashboard.html rename to Application/frontend/views/dashboard.html diff --git a/Application/frontend/frontend/views/index.html b/Application/frontend/views/index.html similarity index 100% rename from Application/frontend/frontend/views/index.html rename to Application/frontend/views/index.html diff --git a/Application/frontend/frontend/views/login.html b/Application/frontend/views/login.html similarity index 100% rename from Application/frontend/frontend/views/login.html rename to Application/frontend/views/login.html diff --git a/Application/frontend/frontend/views/signup.html b/Application/frontend/views/signup.html similarity index 100% rename from Application/frontend/frontend/views/signup.html rename to Application/frontend/views/signup.html diff --git a/Docker/Dockerfile-backend b/Docker/Dockerfile-backend new file mode 100644 index 0000000000000000000000000000000000000000..b2beaa8576b1b8ebfac46357a6647f4facadbeef --- /dev/null +++ b/Docker/Dockerfile-backend @@ -0,0 +1,37 @@ +# Use Python 3.11 slim image as base +FROM python:3.11-slim + +# Set working directory +WORKDIR /app + +# Set environment variables +ENV PYTHONDONTWRITEBYTECODE=1 \ + PYTHONUNBUFFERED=1 \ + FLASK_APP=backend/main.py \ + FLASK_ENV=development + +# Install system dependencies +RUN apt-get update \ + && apt-get install -y --no-install-recommends \ + gcc \ + python3-dev \ + && rm -rf /var/lib/apt/lists/* + +# Copy requirements first to leverage Docker cache +COPY requirements.txt . + +# Install Python dependencies +RUN pip install --no-cache-dir -r requirements.txt + +# Copy the rest of the application +COPY . . + +# Create a non-root user and switch to it +RUN useradd -m appuser && chown -R appuser:appuser /app +USER appuser + +# Expose the port the app runs on +EXPOSE 8000 + +# Command to run the application +CMD ["python3", "backend/main.py"] \ No newline at end of file diff --git a/Docker/Dockerfile-frontend b/Docker/Dockerfile-frontend new file mode 100644 index 0000000000000000000000000000000000000000..c238aa09f66db3b4d2150591d0de4835c42d4001 --- /dev/null +++ b/Docker/Dockerfile-frontend @@ -0,0 +1,24 @@ +# Use Python 3.9 slim image as base +FROM python:3.9-slim + +# Set working directory in container +WORKDIR /app + +# Copy requirements first to leverage Docker cache +COPY requirements.txt . + +# Install dependencies +RUN pip install --no-cache-dir -r requirements.txt + +# Copy the rest of the application +COPY . . + +# Create a non-root user for security +RUN useradd -m myuser +USER myuser + +# Expose the port the app runs on +EXPOSE 3000 + +# Command to run the application +CMD ["python", "main.py"] \ No newline at end of file