https://github.com/agersant/polaris
480
compose.yml:
services:
polaris:
image: ceramicwhite/polaris:latest
container_name: polaris
init: true
user: 1000:1000
restart: unless-stopped
# environment: #Optional
# - POLARIS_PORT=5050
# - POLARIS_CONFIG
# - POLARIS_DB=app/db
# - POLARIS_CACHE_DIR=/app/cache
# - POLARIS_PIDFILE=/tmp/polaris
# - POLARIS_LOGFILE=/app/log
# - POLARIS_LOGLEVEL=1
volumes:
- ./data/music:/music
- ./data/cache:/app/cache
- ./data/logs:/app/log
- ./data/db:/app/db
ports:
- 5050:5050
security_opt:
- no-new-privileges:true
Dockerfile:
ARG POLARIS_VERSION=${POLARIS_VERSION=0.14.0}
FROM rust:alpine AS builder
ARG POLARIS_VERSION
RUN apk --no-progress add build-base curl openssl openssl-dev sqlite-dev
ADD https://github.com/agersant/polaris/releases/download/${POLARIS_VERSION}/Polaris_${POLARIS_VERSION}.tar.gz /build/polaris.tar.gz
RUN cd /build && tar xzf polaris.tar.gz
WORKDIR /build/polaris
RUN POLARIS_WEB_DIR="/app/web" \
POLARIS_SWAGGER_DIR="/app/swagger" \
POLARIS_DB_DIR="/app/db" \
POLARIS_LOG_DIR="/app/log" \
POLARIS_CACHE_DIR="/app/cache" \
POLARIS_PID_DIR="/tmp/polaris" \
RUSTFLAGS="-C target-feature=-crt-static" cargo build --release
RUN /build/polaris/target/release/polaris --help
RUN mkdir /app && \
cp -r /build/polaris/web /app && \
cp -r /build/polaris/swagger /app && \
mv /build/polaris/target/release/polaris /app
ADD https://raw.githubusercontent.com/agersant/polaris/master/README.md /app
ADD https://raw.githubusercontent.com/agersant/polaris/master/LICENSE /app
FROM alpine as app
COPY --from=builder --chown=1000:1000 /app /app
RUN apk --no-progress add libgcc sqlite-libs bash && \
rm -f /var/cache/apk/* && \
ln -s /app/polaris /usr/bin/polaris
USER 1000:1000
WORKDIR /app
ENTRYPOINT polaris -f \
${POLARIS_PORT:+-p ${POLARIS_PORT:-5050}} \
${POLARIS_CONFIG:+-c ${POLARIS_CONFIG}} \
${POLARIS_DB:+-d ${POLARIS_DB:-/app/db}} \
${POLARIS_CACHE_DIR:+--cache ${POLARIS_CACHE_DIR:-/app/cache}} \
${POLARIS_PIDFILE:+--pid ${POLARIS_PIDFILE:-/tmp/polaris}} \
${POLARIS_LOGFILE:+--log ${POLARIS_LOGFILE:-/app/log}} \
${POLARIS_LOGLEVEL:+--log-level ${POLARIS_LOGLEVEL:-1}}
Content type
Image
Digest
sha256:4ee350403…
Size
15.3 MB
Last updated
almost 3 years ago
docker pull ceramicwhite/polaris