forked from raidensakura/hoyolab-auto-login
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
33 lines (20 loc) · 818 Bytes
/
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
FROM python:3.11-alpine as base
RUN apk update && pip install --upgrade pip && \
adduser -D -h /home/autologin -g 'HAL' autologin
WORKDIR /home/autologin
FROM base as builder
ENV POETRY_NO_INTERACTION=1 \
POETRY_VIRTUALENVS_IN_PROJECT=1 \
POETRY_VIRTUALENVS_CREATE=1 \
POETRY_CACHE_DIR=/tmp/poetry_cache
RUN apk add build-base libffi-dev && \
pip install -U poetry
COPY --chown=autologin:autologin poetry.lock pyproject.toml /home/autologin/
RUN --mount=type=cache,target=$POETRY_CACHE_DIR poetry install --without dev --no-root
FROM base as runtime
ENV VIRTUAL_ENV=/home/autologin/.venv \
PATH="/home/autologin/.venv/bin:$PATH"
COPY --from=builder --chown=autologin:autologin ${VIRTUAL_ENV} ${VIRTUAL_ENV}
COPY --chown=autologin:autologin . .
USER autologin
CMD ["python", "hoyolab.py"]