Cosmos-Server/dockerfile

36 lines
919 B
Plaintext
Raw Normal View History

2023-03-10 20:59:56 +00:00
# syntax=docker/dockerfile:1
2023-08-11 09:46:22 +00:00
FROM debian:12
2023-03-10 20:59:56 +00:00
2023-08-11 09:18:24 +00:00
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
2023-03-25 20:15:00 +00:00
EXPOSE 443 80
VOLUME /config
2023-08-11 10:00:07 +00:00
RUN apt-get update \
&& apt-get install -y ca-certificates openssl \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
2023-05-27 17:11:33 +00:00
2023-05-28 10:44:28 +00:00
WORKDIR /app
2023-05-27 17:25:22 +00:00
2023-08-11 09:18:24 +00:00
# Copy the respective binary based on the BINARY_NAME
COPY build/$BINARY_NAME ./
# Copy other resources
COPY build/cosmos_gray.png build/Logo.png build/GeoLite2-Country.mmdb build/meta.json ./
2023-05-28 10:44:28 +00:00
COPY static ./static
2023-03-10 20:59:56 +00:00
2023-08-11 09:18:24 +00:00
# Run the respective binary based on the BINARY_NAME
CMD ["sh", "-c", "./$(cat /binary_name)"]