Cosmos-Server Docker & Self-Hosted Deployment

GitHub

๏ธ The Most Secure and Easy Selfhosted Home Server. Take control of your data and privacy without sacrificing security and stability (Authentication,...

1. Pull Image (DOCKERHUB) docker pull azukaar/Cosmos-Server:latest
2. Docker Run (1-Click Launch) docker run -d --name cosmos-server -p 443:443 --restart always azukaar/cosmos-server:latest
3. Podman Run podman run -d --name cosmos-server -p 443:443 --restart always azukaar/cosmos-server:latest
4. Skopeo Inspect (Zero-Pull Manifest) skopeo inspect docker://docker.io/azukaar/cosmos-server:latest
5. ORAS Pull (OCI Artifact) oras pull azukaar/cosmos-server:latest
dockerfile
# syntax=docker/dockerfile:1

FROM debian:12

ARG TARGETPLATFORM
ARG BINARY_NAME=cosmos

# Set BINARY_NAME based on the TARGETPLATFORM
RUN case "$TARGETPLATFORM" in \
    "linux/arm64") BINARY_NAME="cosmos-arm64" ;; \
    *) BINARY_NAME="cosmos" ;; \
    esac && echo $BINARY_NAME > /binary_name

# This is just to log the platforms (optional)
RUN echo "I am building for $TARGETPLATFORM" > /log

EXPOSE 443 80

VOLUME /config

RUN apt-get update \
    && apt-get install -y ca-certificates openssl fdisk mergerfs snapraid \
       curl unzip wget avahi-daemon avahi-utils samba fuse3 \
    && apt-get clean \
    && rm -rf /var/lib/apt/lists/*

WORKDIR /app

# Copy the respective binary based on the BINARY_NAME
COPY build/cosmos build/cosmos-arm64 ./

# Copy other resources
COPY build/* ./
COPY static ./static

# Run the respective binary based on the BINARY_NAME
CMD ["sh", "-c", "./$(cat /binary_name)"]