Moved frontend out of webserver into it's own container
@@ -15,14 +15,22 @@ services:
|
||||
build:
|
||||
context: ./web_server
|
||||
ports:
|
||||
- "5000:5000"
|
||||
- "5000"
|
||||
networks:
|
||||
- app_network
|
||||
env_file:
|
||||
- .env
|
||||
environment:
|
||||
- FLASK_APP=backend.blueprints.__init__
|
||||
- FLASK_APP=blueprints.__init__
|
||||
- FLASK_DEBUG=True
|
||||
|
||||
frontend:
|
||||
build:
|
||||
context: ./frontend
|
||||
ports:
|
||||
- "5173:5173"
|
||||
networks:
|
||||
- app_network
|
||||
|
||||
networks:
|
||||
app_network:
|
||||
|
||||
20
frontend/Dockerfile
Normal file
@@ -0,0 +1,20 @@
|
||||
# Use the latest LTS version of Node.js
|
||||
FROM node:18-alpine
|
||||
|
||||
# Set the working directory inside the container
|
||||
WORKDIR /frontend
|
||||
|
||||
# Copy package.json and package-lock.json
|
||||
COPY package*.json ./
|
||||
|
||||
# Install dependencies
|
||||
RUN npm install
|
||||
|
||||
# Copy the rest of your application files
|
||||
COPY . .
|
||||
|
||||
# Expose the port your app runs on
|
||||
EXPOSE 5173
|
||||
|
||||
# Define the command to run your app
|
||||
CMD ["npm", "run", "dev"]
|
||||
@@ -31,6 +31,7 @@
|
||||
"tailwindcss": "^3.4.17",
|
||||
"typescript": "~5.6.2",
|
||||
"typescript-eslint": "^8.18.2",
|
||||
"vite": "^6.0.5"
|
||||
"vite": "^6.0.5",
|
||||
"lucide-react": "0.473.0"
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 844 KiB After Width: | Height: | Size: 844 KiB |
|
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 22 KiB |
|
Before Width: | Height: | Size: 167 KiB After Width: | Height: | Size: 167 KiB |
|
Before Width: | Height: | Size: 372 KiB After Width: | Height: | Size: 372 KiB |
|
Before Width: | Height: | Size: 5.2 KiB After Width: | Height: | Size: 5.2 KiB |
|
Before Width: | Height: | Size: 6.5 MiB After Width: | Height: | Size: 6.5 MiB |
@@ -19,8 +19,8 @@ RUN pip install --no-cache-dir -r requirements.txt
|
||||
COPY . .
|
||||
|
||||
# Set environment variables
|
||||
ENV FLASK_APP=backend.blueprints.__init__
|
||||
ENV FLASK_APP=blueprints.__init__
|
||||
ENV FLASK_DEBUG=True
|
||||
|
||||
# Start the Flask app
|
||||
CMD ["gunicorn", "-b", "0.0.0.0:5000", "backend.blueprints.__init__:create_app()"]
|
||||
CMD ["gunicorn", "-b", "0.0.0.0:5000", "blueprints.__init__:create_app()"]
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
from flask import Flask
|
||||
from flask_session import Session
|
||||
from backend.blueprints.utils import logged_in_user
|
||||
from blueprints.utils import logged_in_user
|
||||
from flask_cors import CORS
|
||||
import os
|
||||
|
||||
@@ -21,9 +21,9 @@ def create_app():
|
||||
app.before_request(logged_in_user)
|
||||
|
||||
with app.app_context():
|
||||
from backend.blueprints.authentication import auth_bp
|
||||
from backend.blueprints.main import main_bp
|
||||
from backend.blueprints.stripe import stripe_bp
|
||||
from blueprints.authentication import auth_bp
|
||||
from blueprints.main import main_bp
|
||||
from blueprints.stripe import stripe_bp
|
||||
|
||||
app.register_blueprint(auth_bp)
|
||||
app.register_blueprint(main_bp)
|
||||
@@ -1,8 +1,8 @@
|
||||
from flask import Blueprint, render_template, session, request, url_for, redirect, g
|
||||
from werkzeug.security import generate_password_hash, check_password_hash
|
||||
from backend.forms import SignupForm, LoginForm
|
||||
from backend.database.database import Database
|
||||
from backend.blueprints.utils import login_required
|
||||
from forms import SignupForm, LoginForm
|
||||
from database.database import Database
|
||||
from blueprints.utils import login_required
|
||||
|
||||
auth_bp = Blueprint("auth", __name__)
|
||||
|
||||