docker-seafile-client/Dockerfile

37 lines
1.0 KiB
Docker
Raw Permalink Normal View History

2023-09-15 06:22:21 +00:00
FROM debian:bookworm-slim
2018-04-18 16:32:41 +00:00
2023-09-15 06:22:21 +00:00
# Install seafile client
RUN apt-get update && \
apt-get install gnupg curl python3.11-venv -y && \
rm -rf /var/lib/apt/lists/*
2021-01-30 19:39:34 +00:00
RUN curl https://linux-clients.seafile.com/seafile.asc | apt-key add - && \
2023-09-15 06:22:21 +00:00
echo 'deb [arch=amd64] https://linux-clients.seafile.com/seafile-deb/bookworm/ stable main' \
> /etc/apt/sources.list.d/seafile.list && \
2018-04-18 16:32:41 +00:00
apt-get update -y && \
2023-09-15 06:22:21 +00:00
apt-get install -y seafile-cli && \
2018-04-18 16:32:41 +00:00
rm -rf /var/lib/apt/lists/*
2023-09-15 06:22:21 +00:00
# Use virtual environment
ENV VIRTUAL_ENV=/opt/venv
RUN python3 -m venv $VIRTUAL_ENV
ENV PATH="$VIRTUAL_ENV/bin:$PATH"
# Install app requirements
WORKDIR /dsc
2019-04-13 18:45:06 +00:00
COPY requirements.txt ./
RUN pip install --no-cache-dir -r requirements.txt
2018-04-18 16:32:41 +00:00
2023-09-15 06:22:21 +00:00
# Copy app
2022-01-30 15:27:37 +00:00
COPY dsc ./dsc/
COPY start.py ./start.py
2018-04-18 16:32:41 +00:00
2023-09-15 06:22:21 +00:00
# Create seafile user and init seafile client
RUN chmod +x /dsc/start.py && \
useradd -U -d /dsc -s /bin/bash seafile && \
2018-04-18 16:32:41 +00:00
usermod -G users seafile && \
mkdir -p /dsc/seafile-data && \
chown seafile:seafile -R /dsc
2018-04-18 16:32:41 +00:00
VOLUME /dsc/seafile-data
2019-04-13 18:45:06 +00:00
CMD ["./start.py"]