From d5cd6f3ed0618681d5815d5a2b3315dddc19e57c Mon Sep 17 00:00:00 2001 From: Elias Blume Date: Fri, 29 Apr 2022 00:07:11 +0200 Subject: [PATCH] add docker config for self-hosting --- Dockerfile | 15 +++++++++++++++ README.md | 12 ++++++++++++ docker-compose.yml | 7 +++++++ 3 files changed, 34 insertions(+) create mode 100644 Dockerfile create mode 100644 docker-compose.yml diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..f1ec54c --- /dev/null +++ b/Dockerfile @@ -0,0 +1,15 @@ +FROM node:16 as build + +WORKDIR /build +COPY ./ /build + +RUN yarn install +RUN yarn build + +FROM nginx:alpine +COPY --from=build /build/public /usr/share/nginx/html +# RUN rm /etc/nginx/conf.d/default.conf +# COPY ./nginx.conf /etc/nginx/conf.d + + +EXPOSE 80 \ No newline at end of file diff --git a/README.md b/README.md index a407cdb..e0cc21f 100644 --- a/README.md +++ b/README.md @@ -202,6 +202,18 @@ None at the moment. This project contains static assets that run standalone in the browser. You don't need a server, unless you want to host the assets yourself. +# using docker + +``` +git clone https://github.com/dabbott/javascript-playgrounds.git +cd javascript-playgrounds +docker-compose build + +docker-compose up -d +``` + +and make any changes you need for your personal setup + ### unpkg The recommended host is https://unpkg.com, which is a CDN that serves content from the npm registry. The examples in this README all point to: diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..c9867e4 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,7 @@ +version: '3.3' + +services: + javascript-playgrounds: + build: . + ports: + - 1337:80