Moved frontend out of webserver into it's own container
@@ -15,15 +15,23 @@ services:
|
|||||||
build:
|
build:
|
||||||
context: ./web_server
|
context: ./web_server
|
||||||
ports:
|
ports:
|
||||||
- "5000:5000"
|
- "5000"
|
||||||
networks:
|
networks:
|
||||||
- app_network
|
- app_network
|
||||||
env_file:
|
env_file:
|
||||||
- .env
|
- .env
|
||||||
environment:
|
environment:
|
||||||
- FLASK_APP=backend.blueprints.__init__
|
- FLASK_APP=blueprints.__init__
|
||||||
- FLASK_DEBUG=True
|
- FLASK_DEBUG=True
|
||||||
|
|
||||||
|
frontend:
|
||||||
|
build:
|
||||||
|
context: ./frontend
|
||||||
|
ports:
|
||||||
|
- "5173:5173"
|
||||||
|
networks:
|
||||||
|
- app_network
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
app_network:
|
app_network:
|
||||||
driver: bridge
|
driver: bridge
|
||||||
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",
|
"tailwindcss": "^3.4.17",
|
||||||
"typescript": "~5.6.2",
|
"typescript": "~5.6.2",
|
||||||
"typescript-eslint": "^8.18.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 . .
|
COPY . .
|
||||||
|
|
||||||
# Set environment variables
|
# Set environment variables
|
||||||
ENV FLASK_APP=backend.blueprints.__init__
|
ENV FLASK_APP=blueprints.__init__
|
||||||
ENV FLASK_DEBUG=True
|
ENV FLASK_DEBUG=True
|
||||||
|
|
||||||
# Start the Flask app
|
# 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 import Flask
|
||||||
from flask_session import Session
|
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
|
from flask_cors import CORS
|
||||||
import os
|
import os
|
||||||
|
|
||||||
@@ -21,9 +21,9 @@ def create_app():
|
|||||||
app.before_request(logged_in_user)
|
app.before_request(logged_in_user)
|
||||||
|
|
||||||
with app.app_context():
|
with app.app_context():
|
||||||
from backend.blueprints.authentication import auth_bp
|
from blueprints.authentication import auth_bp
|
||||||
from backend.blueprints.main import main_bp
|
from blueprints.main import main_bp
|
||||||
from backend.blueprints.stripe import stripe_bp
|
from blueprints.stripe import stripe_bp
|
||||||
|
|
||||||
app.register_blueprint(auth_bp)
|
app.register_blueprint(auth_bp)
|
||||||
app.register_blueprint(main_bp)
|
app.register_blueprint(main_bp)
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
from flask import Blueprint, render_template, session, request, url_for, redirect, g
|
from flask import Blueprint, render_template, session, request, url_for, redirect, g
|
||||||
from werkzeug.security import generate_password_hash, check_password_hash
|
from werkzeug.security import generate_password_hash, check_password_hash
|
||||||
from backend.forms import SignupForm, LoginForm
|
from forms import SignupForm, LoginForm
|
||||||
from backend.database.database import Database
|
from database.database import Database
|
||||||
from backend.blueprints.utils import login_required
|
from blueprints.utils import login_required
|
||||||
|
|
||||||
auth_bp = Blueprint("auth", __name__)
|
auth_bp = Blueprint("auth", __name__)
|
||||||
|
|
||||||