-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
67 lines (51 loc) · 1.39 KB
/
Dockerfile
File metadata and controls
67 lines (51 loc) · 1.39 KB
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# Multi-stage build for Rclone Web UI
# Stage 1: Build the React application
FROM node:18-alpine AS builder
WORKDIR /app
# Copy package files
COPY package*.json ./
COPY .npmrc ./
# Install dependencies
# Using npm install instead of npm ci for better compatibility with legacy peer deps
RUN npm install --legacy-peer-deps
# Copy source code
COPY . .
# Build the application
RUN npm run build
# Stage 2: Setup rclone and nginx
FROM alpine:latest
# Install rclone, nginx, and required tools
RUN apk add --no-cache \
rclone \
nginx \
curl \
bash \
ca-certificates \
&& rm -rf /var/cache/apk/*
# Create necessary directories
RUN mkdir -p /run/nginx \
/config/rclone \
/data \
/var/www/html
# Copy built React app from builder
COPY --from=builder /app/build /var/www/html
# Copy nginx configuration
COPY docker/nginx.conf /etc/nginx/nginx.conf
COPY docker/default.conf /etc/nginx/http.d/default.conf
# Copy startup script
COPY docker/start.sh /start.sh
RUN chmod +x /start.sh
# Environment variables with defaults
ENV RCLONE_USER=admin
ENV RCLONE_PASS=admin
ENV RCLONE_PORT=5572
ENV FRONTEND_PORT=3000
# Expose ports
EXPOSE 3000 5572
# Volume for rclone config and data
VOLUME ["/config/rclone", "/data"]
# Health check
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
CMD curl -f http://localhost:3000/ || exit 1
# Start services
CMD ["/start.sh"]