mirror of
https://github.com/rustfs/rustfs.git
synced 2026-09-03 18:55:39 +00:00
Modify Dockerfile
This commit is contained in:
+10
-9
@@ -20,23 +20,24 @@ RUN apk add --no-cache \
|
|||||||
tzdata \
|
tzdata \
|
||||||
&& rm -rf /var/cache/apk/*
|
&& rm -rf /var/cache/apk/*
|
||||||
|
|
||||||
# Create rustfs user and group
|
|
||||||
RUN addgroup -g 1000 rustfs && \
|
|
||||||
adduser -D -s /bin/sh -u 1000 -G rustfs rustfs
|
|
||||||
|
|
||||||
# Create data directories
|
# Create data directories
|
||||||
RUN mkdir -p /data/rustfs && \
|
RUN mkdir -p /data/rustfs
|
||||||
chown -R rustfs:rustfs /data
|
|
||||||
|
|
||||||
# Copy binary based on target architecture
|
# Copy binary based on target architecture
|
||||||
COPY --chown=rustfs:rustfs \
|
COPY target/*/release/rustfs \
|
||||||
target/*/release/rustfs \
|
|
||||||
/usr/local/bin/rustfs
|
/usr/local/bin/rustfs
|
||||||
|
|
||||||
RUN chmod +x /usr/local/bin/rustfs
|
RUN chmod +x /usr/local/bin/rustfs
|
||||||
|
|
||||||
# Switch to non-root user
|
ENV RUSTFS_ROOT_USER=rustfsadmin \
|
||||||
USER rustfs
|
RUSTFS_ROOT_PASSWORD=rustfsadmin \
|
||||||
|
RUSTFS_ADDRESS=":9000" \
|
||||||
|
RUSTFS_CONSOLE_ADDRESS=":9001" \
|
||||||
|
RUSTFS_CONSOLE_ENABLE=true \
|
||||||
|
RUST_LOG=warn
|
||||||
|
|
||||||
|
|
||||||
# Expose ports
|
# Expose ports
|
||||||
EXPOSE 9000 9001
|
EXPOSE 9000 9001
|
||||||
|
|||||||
Reference in New Issue
Block a user