mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-05-28 20:50:20 +00:00
35 lines
919 B
Docker
35 lines
919 B
Docker
# Final stage
|
|
FROM alpine:latest
|
|
|
|
# Install dependencies including Go for the entrypoint script
|
|
RUN apk --no-cache add curl ca-certificates go
|
|
|
|
WORKDIR /root/
|
|
|
|
# Copy gRPC worker files
|
|
COPY ./docker/admin_integration/worker-grpc-entrypoint.sh /entrypoint.sh
|
|
COPY ./docker/admin_integration/worker_grpc_client.go /worker_grpc_client.go
|
|
COPY ./weed/pb/worker.proto /worker.proto
|
|
RUN chmod +x /entrypoint.sh
|
|
|
|
# Create working directories
|
|
RUN mkdir -p /work /tmp/ec_work
|
|
|
|
# Expose worker port
|
|
EXPOSE 9001
|
|
|
|
# Set environment variables
|
|
ENV ADMIN_GRPC_ADDRESS="admin:9901"
|
|
ENV WORKER_ID="worker-1"
|
|
ENV WORKER_ADDRESS="worker:9001"
|
|
ENV CAPABILITIES="erasure_coding"
|
|
ENV MAX_CONCURRENT="2"
|
|
ENV WORK_DIR="/work"
|
|
ENV HEARTBEAT_INTERVAL="10s"
|
|
|
|
# Health check
|
|
HEALTHCHECK --interval=15s --timeout=5s --start-period=30s --retries=3 \
|
|
CMD curl -f http://localhost:9001/health || exit 1
|
|
|
|
# Start worker
|
|
ENTRYPOINT ["/entrypoint.sh"] |