|
|
|
|
|
FROM golang:1.18 AS builder
|
|
|
|
|
|
WORKDIR /app
|
|
|
|
|
|
|
|
|
RUN git clone https://github.com/cloudreve/Cloudreve.git . \
|
|
|
&& git checkout 3.8.3
|
|
|
|
|
|
|
|
|
COPY migration.go /app/models/migration.go
|
|
|
COPY defaults.go /app/models/defaults.go
|
|
|
|
|
|
|
|
|
RUN go mod tidy && go build -o cloudreve
|
|
|
|
|
|
|
|
|
FROM debian:buster-slim
|
|
|
|
|
|
|
|
|
RUN apt-get update && apt-get install -y aria2 && rm -rf /var/lib/apt/lists/*
|
|
|
|
|
|
|
|
|
RUN mkdir -p /app \
|
|
|
&& mkdir -p /aria2/data \
|
|
|
&& chmod 777 /aria2/data \
|
|
|
&& chmod 777 /app
|
|
|
|
|
|
COPY --from=builder /app/cloudreve /app/
|
|
|
|
|
|
|
|
|
COPY aria2.conf /app/aria2.conf
|
|
|
COPY start.sh /app/start.sh
|
|
|
|
|
|
|
|
|
RUN chmod +x /app/cloudreve /app/start.sh
|
|
|
|
|
|
WORKDIR /app
|
|
|
|
|
|
EXPOSE 5212
|
|
|
|
|
|
CMD ["/app/start.sh"] |