Start drawpile

This commit is contained in:
asonix 2020-04-08 19:34:00 -05:00
parent 2b4a90fe1f
commit 99995e1fd8
7 changed files with 146 additions and 0 deletions

53
drawpile/build.sh Executable file
View file

@ -0,0 +1,53 @@
#!/usr/bin//env bash
VERSION=$1
function require() {
if [ "$1" = "" ]; then
echo "input '$2' required"
print_help
exit 1
fi
}
function print_help() {
echo "container.sh"
echo ""
echo "Usage:"
echo " container.sh [version]"
echo ""
echo "Args:"
echo " version: The version of dpserver to build"
}
function build_image() {
IMAGE=$1
ARCH=$2
docker build \
--pull \
--no-cache \
--build-arg "version=${VERSION}" \
-f "Dockerfile.${ARCH}" \
-t "${IMAGE}:${VERSION}-${ARCH}" \
-t "${IMAGE}:latest-${ARCH}" \
-t "${IMAGE}:latest" \
.
docker push "${IMAGE}:${VERSION}-${ARCH}"
docker push "${IMAGE}:latest-${ARCH}"
docker push "${IMAGE}:latest"
}
require "$VERSION" "version"
set -xe
# pushd dpserver
# build_image asonix/drawpile-server arm64v8
# popd
pushd listserver
build_image asonix/drawpile-listserver arm64v8
popd
pushd static
build_image asonix/drawpile-static arm64v8

View file

@ -0,0 +1,26 @@
## Common base
FROM arm64v8/alpine:3.11.3 as common
RUN apk add --no-cache qt5-qtbase qt5-qtbase-sqlite libmicrohttpd libbz2 libsodium
## Build container
FROM common as builder
RUN apk add qt5-qtbase-dev libmicrohttpd-dev libsodium-dev cmake make g++
WORKDIR /build/
COPY build-deps.sh /build/
RUN sh build-deps.sh
ARG version=master
RUN wget https://github.com/drawpile/Drawpile/archive/${version}.zip -O /build/drawpile.zip
COPY build.sh /build/
RUN sh build.sh
## Final deployment image
FROM common
COPY --from=builder /build/drawpile-srv /bin
COPY --from=builder /build/karchive*/build/bin/libKF5* /usr/lib/
RUN adduser -D drawpile
EXPOSE 27750
USER drawpile
ENTRYPOINT ["/bin/drawpile-srv"]

18
drawpile/dpserver/build-deps.sh Executable file
View file

@ -0,0 +1,18 @@
#!/usr/bin/env sh
wget https://github.com/KDE/extra-cmake-modules/archive/v5.55.0.zip -O ecm.zip
wget https://github.com/KDE/karchive/archive/v5.55.0.zip -O karchive.zip
unzip ecm.zip
unzip karchive.zip
cd /build/extra-cmake-modules-*
cmake .
make install
cd /build/karchive-*
mkdir build
cd build
cmake ..
make
make install

9
drawpile/dpserver/build.sh Executable file
View file

@ -0,0 +1,9 @@
#!/usr/bin/env sh
unzip drawpile.zip
cd Drawpile-*/
mkdir build
cd build
cmake .. -DCLIENT=OFF -DSERVER=ON -DSERVERGUI=OFF -DCMAKE_BUILD_TYPE=Release
make
mv bin/drawpile-srv /build/

View file

@ -0,0 +1,10 @@
FROM arm64v8/golang:alpine as builder
RUN apk update && apk add --no-cache git gcc libc-dev
RUN go get github.com/BurntSushi/toml crawshaw.io/sqlite github.com/gorilla/mux github.com/gorilla/handlers github.com/kelseyhightower/envconfig
WORKDIR $GOPATH/src/github.com/drawpile/listserver
COPY . .
RUN go build -o /go/bin/listserver
FROM arm64v8/golang:alpine
COPY --from=builder /go/bin/listserver /go/bin/listserver
ENTRYPOINT ["/go/bin/listserver", "-l", "0.0.0.0:8080"]

View file

@ -0,0 +1,2 @@
FROM arm64v8/nginx:1.17.9-alpine
COPY index.html /usr/share/nginx/html

View file

@ -0,0 +1,28 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Drawpile | asonix.dog</title>
<meta name="drawpile:list-server" content="https://drawpile.asonix.dog/listing" />
</head>
<body>
<h1>Drawpile on asonix.dog</h1>
<p>
This is a free to use <a href="https://drawpile.net/">Drawpile</a> server.
To <a href="https://drawpile.net/help/hosting/">host a session</a> here, select the <i>Remote</i> option
in the Host dialog and enter <code>pub.drawpile.net</code> in the text box.
</p>
<p>
This public server is provided primarily for the benefit of those who are unable to host sessions
on their own computers. It has limited capacity, so please be considerate of others and
try not to monopolize the available space.
</p>
<p>
Sessions hosted (or just listed) here should abide by the
<a href="https://drawpile.net/communities/drawpile.net/ccg/">common community guidelines</a>.
</p>
</body>
</html>