diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..13a14633 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,11 @@ +FROM node:20-slim AS base + +WORKDIR /usr/src/hexo + +COPY package*.json ./ + +COPY . . + +RUN npm run clean && npm run build + +CMD ["npm", "test"] diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 00000000..1b957238 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,14 @@ +version: '3.8' + +services: + hexo: + build: . + container_name: hexo-dev + image: hexo-dev:latest + volumes: + - .:/usr/src/hexo + working_dir: /usr/src/hexo + command: npm test + environment: + - NODE_ENV=development + tty: true