mirror of
https://github.com/StarFleetCPTN/GoMFT.git
synced 2026-09-08 23:50:48 +02:00
- Implement concurrent file transfer processing with configurable concurrency - Add new `max_concurrent_transfers` column to transfer configurations - Enhance scheduler to support multi-threaded file transfers - Introduce advanced logging system with rotation and configurable log levels - Update Docker Compose and documentation with new logging configuration options - Modify directory structure to separate data, backups, and logs - Add environment variables for comprehensive logging control - Improve error handling and logging in file transfer processes
61 lines
1.4 KiB
Docker
61 lines
1.4 KiB
Docker
FROM golang:1.24-alpine AS builder
|
|
|
|
WORKDIR /app
|
|
|
|
# Install build dependencies
|
|
RUN apk add --no-cache git build-base
|
|
|
|
# Install templ compiler
|
|
RUN go install github.com/a-h/templ/cmd/templ@latest
|
|
|
|
# Copy go module files first for better layer caching
|
|
COPY go.mod go.sum ./
|
|
RUN go mod download
|
|
|
|
# Copy the rest of the source code
|
|
COPY . .
|
|
|
|
# Generate template files from .templ files
|
|
RUN templ generate
|
|
|
|
# Build the application
|
|
RUN CGO_ENABLED=1 GOOS=linux go build -o gomft
|
|
|
|
# Install rclone
|
|
RUN apk add --no-cache curl unzip && \
|
|
curl -O https://downloads.rclone.org/rclone-current-linux-amd64.zip && \
|
|
unzip rclone-current-linux-amd64.zip && \
|
|
cd rclone-*-linux-amd64 && \
|
|
cp rclone /usr/local/bin/ && \
|
|
chmod 755 /usr/local/bin/rclone && \
|
|
cd .. && \
|
|
rm -rf rclone*
|
|
|
|
# Create a smaller runtime image
|
|
FROM alpine:3.19
|
|
|
|
WORKDIR /app
|
|
|
|
# Install runtime dependencies
|
|
RUN apk add --no-cache ca-certificates tzdata sqlite bash
|
|
|
|
# Copy the binary from the builder stage
|
|
COPY --from=builder /app/gomft /app/
|
|
COPY --from=builder /usr/local/bin/rclone /usr/local/bin/rclone
|
|
|
|
# Copy static files and configurations
|
|
COPY static/ /app/static/
|
|
COPY components/ /app/components/
|
|
|
|
# Create data and backup directories
|
|
RUN mkdir -p /app/data /app/backups
|
|
|
|
# Set executable permissions
|
|
RUN chmod +x /app/gomft
|
|
|
|
# Expose the application port
|
|
EXPOSE 8080
|
|
|
|
# Run the application
|
|
CMD ["/app/gomft"]
|