Spaces:
Running
Running
File size: 879 Bytes
f689506 2fe6d71 f689506 20d9d4f f689506 2fe6d71 f689506 20d9d4f f689506 20d9d4f f689506 20d9d4f f689506 71f0244 f689506 20d9d4f f689506 20d9d4f f689506 2fe6d71 f689506 20d9d4f a0e371c |
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 |
# Build stage
FROM golang:1.18 AS builder
WORKDIR /app
# Clone the repository
RUN git clone https://github.com/cloudreve/Cloudreve.git .
# Copy custom files
COPY migration.go /app/models/migration.go
# Build the application
RUN go mod tidy && go build -o cloudreve
# Final stage
FROM debian:buster-slim
# Install aria2
RUN apt-get update && apt-get install -y aria2 && rm -rf /var/lib/apt/lists/*
# Create necessary directories
RUN mkdir -p /app \
&& mkdir -p /aria2/data \
&& chmod 777 /aria2/data \
&& chmod 777 /app
# Copy the built executable from the builder stage
COPY --from=builder /app/cloudreve /app/
# Copy configuration files and scripts
COPY aria2.conf /app/aria2.conf
COPY start.sh /app/start.sh
# Set permissions
RUN chmod +x /app/cloudreve /app/start.sh
WORKDIR /app
EXPOSE 5212
CMD ["/app/start.sh"] |