From bdc074b0d90a1aa3b2eba7febef99935344e0bca Mon Sep 17 00:00:00 2001 From: Oscar Beaumont Date: Sat, 23 Apr 2022 23:41:11 +0800 Subject: [PATCH] added Dockerfile for sdserver --- apps/server/Dockerfile | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/apps/server/Dockerfile b/apps/server/Dockerfile index 027305bb3..fa1728122 100644 --- a/apps/server/Dockerfile +++ b/apps/server/Dockerfile @@ -1,7 +1,28 @@ -FROM gcr.io/distroless/cc +FROM debian:stable-slim +# Arguments and labels +ARG USER=spaceboy +LABEL org.opencontainers.image.title="Spacedrive Server" +LABEL org.opencontainers.image.source="https://github.com/spacedriveapp/spacedrive" + +# Install dependencies +RUN apt-get update && apt-get install -y libavdevice-dev libavfilter-dev libavformat-dev libavcodec-dev libavutil-dev + +# Copy the compiled server CLI into the container COPY ./server /sdserver +# Expose webserver EXPOSE 8080 +# Create the data directory to store the database +RUN mkdir /data +ENV DATA_DIR /data + +# Drop privledges to non-root user +RUN adduser --system --no-create-home --shell /usr/sbin/nologin $USER && \ + chown -R $USER /data && \ + chmod -R 770 /data +USER $USER + +# Run the CLI when the container is started ENTRYPOINT [ "/sdserver" ]