direct to main for docker and logging fix
This commit is contained in:
@@ -10,3 +10,4 @@ __pycache__
|
||||
Dockerfile
|
||||
docker-compose.yml
|
||||
log.md
|
||||
.vscode
|
||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1,5 +1,6 @@
|
||||
log.md
|
||||
.env
|
||||
.vscode
|
||||
|
||||
# Byte-compiled / optimized / DLL files
|
||||
__pycache__/
|
||||
|
||||
@@ -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"]
|
||||
|
||||
10
app/main.py
10
app/main.py
@@ -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.")
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user