-
-
Notifications
You must be signed in to change notification settings - Fork 130
/
Dockerfile
55 lines (39 loc) · 1.21 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# SPDX-FileCopyrightText: 2024 Tazlin
# SPDX-FileCopyrightText: 2024 ceruleandeep
#
# SPDX-License-Identifier: AGPL-3.0-or-later
# Use a slim base image for Python 3.10
FROM python:3.10-slim AS python
##
## BUILD STAGE
##
FROM python AS python-build-stage
# Install Git
RUN apt-get update && apt-get install -y git
RUN --mount=type=cache,target=/root/.cache pip install --upgrade pip
# Build dependencies
COPY ./requirements.txt .
RUN --mount=type=cache,target=/root/.cache \
pip wheel --wheel-dir /usr/src/app/wheels \
-r requirements.txt
##
## RUN STAGE
##
FROM python AS python-run-stage
# git is required in the run stage because one dependency is not available in PyPI
RUN apt-get update && apt-get install -y git
RUN --mount=type=cache,target=/root/.cache pip install --upgrade pip
# Install dependencies
COPY --from=python-build-stage /usr/src/app/wheels /wheels/
COPY ./requirements.txt .
RUN pip install --no-cache-dir --no-index --find-links=/wheels/ \
-r requirements.txt \
&& rm -rf /wheels/
WORKDIR /app
COPY . /app
# Set the environment variables
ENV PROFILE=""
# Set the command to run when the container starts
CMD ["python", "server.py", "-vvvvi", "--horde", "stable"]
# Expose the port
EXPOSE 7001