added Dockerfile for sdserver

This commit is contained in:
Oscar Beaumont
2022-04-23 23:41:11 +08:00
parent 602d0fbf05
commit bdc074b0d9

View File

@@ -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" ]