build: add Docker
This commit is contained in:
commit
96167de713
4 changed files with 41 additions and 0 deletions
3
.dockerignore
Normal file
3
.dockerignore
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
/Dockerfile
|
||||||
|
/docker-compose.yaml
|
||||||
|
/node_modules/
|
15
Dockerfile
Normal file
15
Dockerfile
Normal 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
9
docker-compose.yaml
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
services:
|
||||||
|
app:
|
||||||
|
build:
|
||||||
|
context: "."
|
||||||
|
volumes:
|
||||||
|
- "./:/app"
|
||||||
|
ports:
|
||||||
|
- "3000:3000"
|
||||||
|
command: ["next", "dev"]
|
14
justfile
Normal file
14
justfile
Normal 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}}
|
Loading…
Add table
Add a link
Reference in a new issue