Hastebin rolling release
Add first test files for a hastebin build from master Signed-off-by: Armin Friedl <dev@friedl.net>
This commit is contained in:
commit
f089a6051e
4 changed files with 91 additions and 0 deletions
25
.drone.yml
Normal file
25
.drone.yml
Normal file
|
@ -0,0 +1,25 @@
|
|||
kind: pipeline
|
||||
type: docker
|
||||
name: latest
|
||||
|
||||
steps:
|
||||
- name: publish
|
||||
image: plugins/docker
|
||||
settings:
|
||||
username:
|
||||
from_secret: docker_username
|
||||
password:
|
||||
from_secret: docker_password
|
||||
dockerfile: latest/Dockerfile
|
||||
context: latest/
|
||||
build-args:
|
||||
- HASTEBIN_VERSION=master
|
||||
purge: true
|
||||
repo: arminfriedl/hastebin
|
||||
tags: latest
|
||||
|
||||
trigger:
|
||||
event:
|
||||
- cron
|
||||
cron:
|
||||
- hourly
|
27
latest/Dockerfile
Normal file
27
latest/Dockerfile
Normal file
|
@ -0,0 +1,27 @@
|
|||
FROM node:current-alpine
|
||||
|
||||
ARG HASTEBIN_VERSION
|
||||
ENV UID=1005 GID=1005
|
||||
|
||||
COPY run.sh /usr/local/bin/run.sh
|
||||
|
||||
RUN apk -U upgrade \
|
||||
&& apk --no-cache add git su-exec \
|
||||
&& git clone https://github.com/seejohnrun/haste-server.git /app \
|
||||
&& cd app \
|
||||
&& git checkout ${HASTEBIN_VERSION} \
|
||||
&& npm install \
|
||||
&& npm cache clean --force \
|
||||
&& apk del git \
|
||||
&& rm -rf /var/lib/apk/* /var/cache/apk/* \
|
||||
&& chmod +x /usr/local/bin/run.sh
|
||||
|
||||
# we cannot copy this before the RUN because
|
||||
# git clone will fail if app/ is not empty
|
||||
COPY config.js /app/config.js
|
||||
|
||||
WORKDIR /app
|
||||
VOLUME /app/data
|
||||
EXPOSE 7777
|
||||
|
||||
ENTRYPOINT ["run.sh"]
|
31
latest/config.js
Normal file
31
latest/config.js
Normal file
|
@ -0,0 +1,31 @@
|
|||
{
|
||||
"host": "0.0.0.0",
|
||||
"port": 7777,
|
||||
"keyLength": 10,
|
||||
"maxLength": 400000,
|
||||
"staticMaxAge": 86400,
|
||||
"recompressStaticAssets": true,
|
||||
"logging": [{
|
||||
"level": "error",
|
||||
"type": "Console",
|
||||
"colorize": true
|
||||
}],
|
||||
"keyGenerator": {
|
||||
"type": "phonetic"
|
||||
},
|
||||
"rateLimits": {
|
||||
"categories": {
|
||||
"normal": {
|
||||
"totalRequests": 500,
|
||||
"every": 60000
|
||||
}
|
||||
}
|
||||
},
|
||||
"storage": {
|
||||
"type": "file",
|
||||
"path": "./data"
|
||||
},
|
||||
"documents": {
|
||||
"about": "./about.md"
|
||||
}
|
||||
}
|
8
latest/run.sh
Normal file
8
latest/run.sh
Normal file
|
@ -0,0 +1,8 @@
|
|||
#!/bin/sh
|
||||
|
||||
set -xe
|
||||
|
||||
# we have to run the chown here since the VOLUME is mounted
|
||||
# after the build with root:root
|
||||
chown -R ${UID}:${GID} /app
|
||||
su-exec ${UID}:${GID} npm start
|
Loading…
Reference in a new issue