chore: add docker

This commit is contained in:
Damillora 2021-05-12 06:22:25 +07:00
parent c2796ebe8b
commit 464d8974a6
4 changed files with 2812 additions and 0 deletions

1
.dockerignore Normal file
View File

@ -0,0 +1 @@
node_modules

32
.github/workflows/workflow.yml vendored Normal file
View File

@ -0,0 +1,32 @@
name: CI
on:
push:
branches:
- main
jobs:
release:
runs-on: ubuntu-latest
steps:
-
name: Set up QEMU
uses: docker/setup-qemu-action@v1
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
-
name: Login to DockerHub
uses: docker/login-action@v1
with:
registry: registry.nanao.moe
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
-
name: Build and push
id: docker_build
uses: docker/build-push-action@v2
with:
push: true
tags: damillora/shioriko:latest
-
name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}

24
Dockerfile Normal file
View File

@ -0,0 +1,24 @@
FROM node:14
# install dependencies
WORKDIR /app
COPY package.json package-lock.json ./
RUN yarn install
# Copy all local files into the image.
COPY . .
RUN yarn build
###
# Only copy over the Node pieces we need
# ~> Saves 35MB
###
FROM node:14-slim
WORKDIR /app
COPY --from=0 /app .
COPY . .
EXPOSE 3000
CMD ["node", "./build"]

2755
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff