From 44d33bedb5e9cf32d0f8d850601d8b3b17b76840 Mon Sep 17 00:00:00 2001 From: Henk Verlinde Date: Fri, 30 Aug 2024 10:22:10 +0200 Subject: [PATCH] Add CodeSandbox support --- .codesandbox/tasks.json | 22 ++++++++++++++++++++++ .devcontainer/Dockerfile | 19 +++++++++++++++++++ .devcontainer/devcontainer.json | 5 +++++ 3 files changed, 46 insertions(+) create mode 100644 .codesandbox/tasks.json create mode 100644 .devcontainer/Dockerfile create mode 100644 .devcontainer/devcontainer.json diff --git a/.codesandbox/tasks.json b/.codesandbox/tasks.json new file mode 100644 index 0000000..52bc2c2 --- /dev/null +++ b/.codesandbox/tasks.json @@ -0,0 +1,22 @@ +{ + // These tasks will run in order when initializing your CodeSandbox project. + "setupTasks": [ + { + "name": "Install Dependencies", + "command": "npm install" + } + ], + + // These tasks can be run from CodeSandbox. Running one will open a log in the app. + "tasks": { + "start": { + "name": "dev", + "command": "npm run dev -- --baseURL=/ --appendPort=false --liveReloadPort=443 --bind=0.0.0.0", + "runAtStart": true + }, + "install": { + "name": "install dependencies", + "command": "npm install" + } + } +} diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 0000000..2633b24 --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1,19 @@ +FROM mcr.microsoft.com/devcontainers/base:ubuntu-22.04 + +RUN apt-get update && \ + apt-get install -y \ + ca-certificates \ + nodejs \ + npm \ + wget && \ + update-ca-certificates + +ARG HUGO_VERSION="0.131.0" +RUN wget --quiet "https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_Linux-64bit.tar.gz" && \ + tar xzf hugo_extended_${HUGO_VERSION}_Linux-64bit.tar.gz && \ + rm -r hugo_extended_${HUGO_VERSION}_Linux-64bit.tar.gz && \ + mv hugo /usr/bin && \ + chmod 755 /usr/bin/hugo + +WORKDIR /src +COPY ./ /src diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000..2cb9488 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,5 @@ +{ + "build": { + "dockerfile": "./Dockerfile" + } +}