-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
49 lines (36 loc) · 1.04 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
#
# Build
#
FROM python:3.12-alpine as builder
WORKDIR /src
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
COPY . /src
RUN pip install --no-cache-dir cement && \
pip wheel --no-cache-dir --no-deps --wheel-dir /src/wheels -r requirements.txt && \
pip wheel --no-cache-dir --no-deps --wheel-dir /src/wheels .
#
# Prod
#
FROM python:3.12-alpine
# Non root user
RUN adduser -D seedboxsync
WORKDIR /src
# System folders
RUN mkdir /config && \
mkdir /downloads && \
mkdir /watch && \
chown -R seedboxsync:seedboxsync /config /downloads /watch
# Add cement for setup.py before
COPY --from=builder /src/wheels wheels
RUN pip install --no-cache-dir wheels/* && \
rm -rf /src
USER seedboxsync
# Seedboxsync folders
RUN mkdir ~seedboxsync/.config && \
ln -s /config ~seedboxsync/.config/seedboxsync && \
ln -s /downloads ~seedboxsync/Downloads && \
ln -s /watch ~seedboxsync/watch && \
cp /usr/local/config/seedboxsync.yml.example /config/seedboxsync.yml
WORKDIR /home/seedboxsync
ENTRYPOINT ["/usr/local/bin/seedboxsync"]