You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

56 lines
1.2 KiB

# Build
FROM golang:alpine
RUN apk add --no-cache -U build-base git make ffmpeg-dev
RUN mkdir -p /src
# Copy Makefile
COPY Makefile ./
# Copy go.mod and go.sum and install and cache dependencies
COPY go.mod .
COPY go.sum .
# Install deps
RUN make deps
RUN go mod download
# Copy default logo
COPY ./internal/logo.svg ./internal/
# Copy static assets
COPY ./internal/theme/static/css/* ./internal/theme/static/css/
COPY ./internal/theme/static/img/* ./internal/theme/static/img/
COPY ./internal/theme/static/js/* ./internal/theme/static/js/
# Copy pages
COPY ./internal/pages/* ./internal/pages/
# Copy templates
COPY ./internal/theme/templates/* ./internal/theme/templates/
# Copy langs (localization / i18n)
COPY ./internal/langs/* ./internal/langs/
# Copy sources
COPY *.go ./
COPY ./internal/*.go ./internal/
COPY ./internal/auth/*.go ./internal/auth/
COPY ./internal/session/*.go ./internal/session/
COPY ./internal/passwords/*.go ./internal/passwords/
COPY ./internal/indieweb/*.go ./internal/indieweb/
COPY ./cmd/yarnd/*.go ./cmd/yarnd/
# Build server binary
RUN make server DEBUG=1
VOLUME /src/data
# force cgo resolver
ENV GODEBUG=netdns=cgo
CMD ["./yarnd", "-D", "-O", "-R"]