build: add Docker

This commit is contained in:
Oliver Davies 2022-09-09 18:00:00 +01:00
commit 96167de713
4 changed files with 41 additions and 0 deletions

3
.dockerignore Normal file
View file

@ -0,0 +1,3 @@
/Dockerfile
/docker-compose.yaml
/node_modules/

15
Dockerfile Normal file
View file

@ -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 . .

9
docker-compose.yaml Normal file
View file

@ -0,0 +1,9 @@
services:
app:
build:
context: "."
volumes:
- "./:/app"
ports:
- "3000:3000"
command: ["next", "dev"]

14
justfile Normal file
View file

@ -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}}