From 47e8b8ecfb6ad7823d1e46f5f457bb966f858f72 Mon Sep 17 00:00:00 2001 From: Khue Doan Date: Fri, 26 Jun 2020 14:51:53 +0700 Subject: [PATCH] Add paste bin service --- docker-compose.yml | 3 +++ nginx/default.conf | 10 ++++++++++ pastebin/Dockerfile | 7 +++++++ 3 files changed, 20 insertions(+) create mode 100644 pastebin/Dockerfile diff --git a/docker-compose.yml b/docker-compose.yml index b4d66491..3c796577 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -31,3 +31,6 @@ services: environment: MYSQL_ROOT_PASSWORD: $MYSQL_ROOT_PASSWORD MYSQL_DATABASE: "gitea" + pastebin: + container_name: "khuedoan_pastebin" + build: ./pastebin/ diff --git a/nginx/default.conf b/nginx/default.conf index f36e4d18..80d69c97 100644 --- a/nginx/default.conf +++ b/nginx/default.conf @@ -17,3 +17,13 @@ server { proxy_pass http://gitea:3000; } } + +server { + listen 80; + listen [::]:80; + server_name pastebin.khuedoan.com; + + location / { + proxy_pass http://pastebin:8000; + } +} diff --git a/pastebin/Dockerfile b/pastebin/Dockerfile new file mode 100644 index 00000000..4cf04c87 --- /dev/null +++ b/pastebin/Dockerfile @@ -0,0 +1,7 @@ +FROM alpine:3.12.0 + +ADD https://github.com/w4/bin/releases/download/v1.0.3/bin-v1.0.3-x86_64-unknown-linux-musl.tar.gz /tmp/ + +RUN tar -xvzf /tmp/bin-*.tar.gz -C /usr/local/bin/ && rm /tmp/bin-*.tar.gz + +CMD [ "bin" ]