direct to main for docker and logging fix

This commit is contained in:
ForeverPyrite
2024-12-10 23:52:01 -05:00
parent deee193a43
commit 48004df115
6 changed files with 21 additions and 14 deletions

View File

@@ -10,3 +10,4 @@ __pycache__
Dockerfile
docker-compose.yml
log.md
.vscode

1
.gitignore vendored
View File

@@ -1,5 +1,6 @@
log.md
.env
.vscode
# Byte-compiled / optimized / DLL files
__pycache__/

View File

@@ -15,17 +15,17 @@ WORKDIR /app
# Install Python dependencies
COPY requirements.txt .
RUN pip install --upgrade pip
RUN pip install --no-cache-dir -r requirements.txt
RUN pip install --upgrade pip && pip install --no-cache-dir -r requirements.txt
# Copy application files
COPY . /app
# Make start.sh executable
RUN chmod +x start.sh
COPY start.sh .
RUN chmod +x ./start.sh
# Expose the port the app runs on
EXPOSE 1986
# Specify the entrypoint script
ENTRYPOINT ["./start.sh"]
ENTRYPOINT ["/app/start.sh"]

View File

@@ -58,8 +58,12 @@ import pytz
from datetime import datetime
def log(str):
with open("logs/log.md", "at") as file:
file.write(str)
try:
with open("logs/log.md", "a") as file:
file.write(str)
except FileNotFoundError:
os.system("touch logs/log.md")
log("#### log.md was not found, so it was just touched.")
### OpenAI Config
@@ -126,3 +130,5 @@ def get_auto_transcript(video_id):
return txt_transcript
output_stream = StreamOutput()
log(f"# Main initilized at {datetime.now(pytz.timezone('America/New_York')).strftime('%Y-%m-%d %H:%M:%S')}. Presumeably application starting.")

View File

@@ -1,13 +1,12 @@
version: '3.8'
services:
app:
build: .
container_name: screw-bardo-container
container_name: screw-bardo
ports:
- "1986:1986"
env_file:
- .env
volumes:
- ./logs:/app/logs
- ./app/logs:/app/app/logs/:rw
restart: unless-stopped

View File

@@ -1,3 +1,3 @@
#!/bin/bash
cd ./app
cd app
exec gunicorn -b 0.0.0.0:1986 --log-level debug app:app