Use debian as base docker image
This commit is contained in:
parent
639265f718
commit
9f6c417147
21
Dockerfile
21
Dockerfile
@ -1,19 +1,31 @@
|
|||||||
FROM python:3.8.12-slim-buster
|
FROM debian:bookworm-slim
|
||||||
|
|
||||||
RUN apt-get update && apt-get install gnupg curl -y && rm -rf /var/lib/apt/lists/*
|
# Install seafile client
|
||||||
|
RUN apt-get update && \
|
||||||
|
apt-get install gnupg curl python3.11-venv -y && \
|
||||||
|
rm -rf /var/lib/apt/lists/*
|
||||||
RUN curl https://linux-clients.seafile.com/seafile.asc | apt-key add - && \
|
RUN curl https://linux-clients.seafile.com/seafile.asc | apt-key add - && \
|
||||||
echo 'deb [arch=amd64] https://linux-clients.seafile.com/seafile-deb/buster/ stable main' > /etc/apt/sources.list.d/seafile.list && \
|
echo 'deb [arch=amd64] https://linux-clients.seafile.com/seafile-deb/bookworm/ stable main' \
|
||||||
|
> /etc/apt/sources.list.d/seafile.list && \
|
||||||
apt-get update -y && \
|
apt-get update -y && \
|
||||||
apt-get install -y seafile-cli procps grep && \
|
apt-get install -y seafile-cli && \
|
||||||
rm -rf /var/lib/apt/lists/*
|
rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
# Use virtual environment
|
||||||
|
ENV VIRTUAL_ENV=/opt/venv
|
||||||
|
RUN python3 -m venv $VIRTUAL_ENV
|
||||||
|
ENV PATH="$VIRTUAL_ENV/bin:$PATH"
|
||||||
|
|
||||||
|
# Install app requirements
|
||||||
WORKDIR /seafile-client
|
WORKDIR /seafile-client
|
||||||
COPY requirements.txt ./
|
COPY requirements.txt ./
|
||||||
RUN pip install --no-cache-dir -r requirements.txt
|
RUN pip install --no-cache-dir -r requirements.txt
|
||||||
|
|
||||||
|
# Copy app
|
||||||
COPY dsc ./dsc/
|
COPY dsc ./dsc/
|
||||||
COPY start.py ./start.py
|
COPY start.py ./start.py
|
||||||
|
|
||||||
|
# Create seafile user and init seafile client
|
||||||
RUN chmod +x /seafile-client/start.py && \
|
RUN chmod +x /seafile-client/start.py && \
|
||||||
useradd -U -d /seafile-client -s /bin/bash seafile && \
|
useradd -U -d /seafile-client -s /bin/bash seafile && \
|
||||||
usermod -G users seafile && \
|
usermod -G users seafile && \
|
||||||
@ -21,5 +33,4 @@ RUN chmod +x /seafile-client/start.py && \
|
|||||||
su - seafile -c "seaf-cli init -d /seafile-client"
|
su - seafile -c "seaf-cli init -d /seafile-client"
|
||||||
|
|
||||||
VOLUME /seafile-client/seafile-data
|
VOLUME /seafile-client/seafile-data
|
||||||
|
|
||||||
CMD ["./start.py"]
|
CMD ["./start.py"]
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user