zekey8918 commited on
Commit
ff876f4
·
verified ·
1 Parent(s): 7375fa8

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +30 -0
Dockerfile ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.12-slim-bookworm
2
+
3
+ # Create app user and directory
4
+ RUN useradd -m appuser && \
5
+ mkdir /app && \
6
+ chown appuser:appuser /app
7
+
8
+ WORKDIR /app
9
+
10
+ # Install build dependencies and git, clone repo (keeping build dependencies)
11
+ RUN apt-get update && \
12
+ apt-get install -y --no-install-recommends git gcc python3-dev && \
13
+ git clone https://github.com/SeoulDroid99100/Manhwa-Bot . && \
14
+ rm -rf /var/lib/apt/lists/*
15
+
16
+ # Switch to appuser and set up virtual environment
17
+ USER appuser
18
+ RUN python -m venv venv
19
+ ENV PATH="/app/venv/bin:$PATH"
20
+
21
+ # Create log directory with write permissions
22
+ USER root
23
+ RUN mkdir -p /app/logs && chmod 777 /app/logs
24
+ USER appuser
25
+
26
+ RUN pip install -r requirements.txt
27
+ EXPOSE 7860
28
+ #Sex test
29
+ # Run from module
30
+ CMD ["python3","main.py"]