Iwak
commited on
Commit
·
1b23019
1
Parent(s):
bbdb47d
- Dockerfile +33 -11
- main.py +1 -1
Dockerfile
CHANGED
@@ -6,31 +6,53 @@ RUN apt-get update && \
|
|
6 |
apt-get install -y pipenv && \
|
7 |
rm -rf /var/lib/apt/lists/*
|
8 |
|
9 |
-
# Create a non-root user and set up home directory
|
10 |
-
RUN useradd -m myuser
|
11 |
-
|
12 |
-
# Create a writable directory and set appropriate permissions
|
13 |
-
RUN mkdir -p /app/data && chown -R myuser:myuser /app/data
|
14 |
-
|
15 |
-
# Switch to the non-root user
|
16 |
-
USER myuser
|
17 |
-
|
18 |
ENV PORT=7860
|
|
|
|
|
19 |
ENV PIPENV_VENV_IN_PROJECT=1
|
20 |
|
21 |
WORKDIR /app
|
22 |
|
23 |
# Copy the requirements file
|
24 |
-
COPY
|
25 |
|
26 |
# Install dependencies into a pipenv environment within the project
|
27 |
RUN pipenv install --dev --ignore-pipfile
|
28 |
|
29 |
# Copy the rest of the application code
|
30 |
-
COPY
|
31 |
|
32 |
# Expose the application port
|
33 |
EXPOSE 7860
|
34 |
|
|
|
|
|
|
|
35 |
# Run the application using pipenv
|
36 |
CMD pipenv run python -m gunicorn main:app -b 0.0.0.0:7860 -w 8 --timeout 600
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6 |
apt-get install -y pipenv && \
|
7 |
rm -rf /var/lib/apt/lists/*
|
8 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9 |
ENV PORT=7860
|
10 |
+
|
11 |
+
# Set Pipenv to create the virtual environment in the project directory
|
12 |
ENV PIPENV_VENV_IN_PROJECT=1
|
13 |
|
14 |
WORKDIR /app
|
15 |
|
16 |
# Copy the requirements file
|
17 |
+
COPY requirements.txt .
|
18 |
|
19 |
# Install dependencies into a pipenv environment within the project
|
20 |
RUN pipenv install --dev --ignore-pipfile
|
21 |
|
22 |
# Copy the rest of the application code
|
23 |
+
COPY . .
|
24 |
|
25 |
# Expose the application port
|
26 |
EXPOSE 7860
|
27 |
|
28 |
+
# Ensure Python is installed correctly
|
29 |
+
RUN python -V
|
30 |
+
|
31 |
# Run the application using pipenv
|
32 |
CMD pipenv run python -m gunicorn main:app -b 0.0.0.0:7860 -w 8 --timeout 600
|
33 |
+
|
34 |
+
|
35 |
+
# ARG PYTHON_VERSION=3.10.13
|
36 |
+
# FROM python:${PYTHON_VERSION}-slim AS base
|
37 |
+
|
38 |
+
# RUN apt-get update && apt-get install -y sudo && rm -rf /var/lib/apt/lists/*
|
39 |
+
|
40 |
+
# ENV PORT=7860
|
41 |
+
|
42 |
+
# RUN ls
|
43 |
+
|
44 |
+
# WORKDIR /app
|
45 |
+
|
46 |
+
# RUN ls
|
47 |
+
|
48 |
+
# copy requirements.txt .
|
49 |
+
# RUN python -m pip install --upgrade pip
|
50 |
+
# RUN python -m pip install -r requirements.txt
|
51 |
+
|
52 |
+
# COPY . .
|
53 |
+
|
54 |
+
# EXPOSE 7860
|
55 |
+
|
56 |
+
# RUN python -V
|
57 |
+
|
58 |
+
# CMD sudo python -m gunicorn main:app -b 0.0.0.0:7860 -w 8 --timeout 600
|
main.py
CHANGED
@@ -11,7 +11,7 @@ enka_update = EnkaNetworkAPI()
|
|
11 |
|
12 |
async def update_genshin():
|
13 |
async with enka_update:
|
14 |
-
await enka_update.update_assets(lang = ["EN"])
|
15 |
|
16 |
app = Flask(__name__)
|
17 |
|
|
|
11 |
|
12 |
async def update_genshin():
|
13 |
async with enka_update:
|
14 |
+
await enka_update.update_assets(lang = ["EN"], path="/tmp/")
|
15 |
|
16 |
app = Flask(__name__)
|
17 |
|