commit 96167de7137b31e7f1ce5ea54fd63b74ec478fbf Author: Oliver Davies Date: Fri Sep 9 18:00:00 2022 +0100 build: add Docker diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..d32560f --- /dev/null +++ b/.dockerignore @@ -0,0 +1,3 @@ +/Dockerfile +/docker-compose.yaml +/node_modules/ diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..4677849 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,15 @@ +FROM node:16-bullseye AS base + +ENV PATH=${PATH}:/app/node_modules/.bin + +WORKDIR /app + +RUN chown node:node -R /app + +USER node + +COPY --chown=node:node package.* ./ + +RUN npm install + +COPY --chown=node:node . . diff --git a/docker-compose.yaml b/docker-compose.yaml new file mode 100644 index 0000000..97e5bb5 --- /dev/null +++ b/docker-compose.yaml @@ -0,0 +1,9 @@ +services: + app: + build: + context: "." + volumes: + - "./:/app" + ports: + - "3000:3000" + command: ["next", "dev"] diff --git a/justfile b/justfile new file mode 100644 index 0000000..a4bcec8 --- /dev/null +++ b/justfile @@ -0,0 +1,14 @@ +default: + just --list + +down: + docker compose down + +npm *args: + just _run npm {{args}} + +up *args: + docker compose up {{args}} + +_run +args: + docker compose run --rm --entrypoint bash app -c {{args}}