diff --git a/.dockerignore b/.dockerignore index df4469b..9656cef 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,6 +1,16 @@ -docs +src test images +docs node_modules package-lock.json -yarn.lock \ No newline at end of file +Dockerfile +yarn.lock +.yarn +.vscode +.github +*.env +*.gitignore +.yarnrc.yml +.nest-cli.json +.dockerignore \ No newline at end of file diff --git a/.eslintrc.json b/.eslintrc.json deleted file mode 100644 index edd600f..0000000 --- a/.eslintrc.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "env": { - "browser": true, - "commonjs": true, - "es2021": true - }, - "extends": [ - "standard" - ], - "parserOptions": { - "ecmaVersion": 12 - }, - "rules": { - "semi": ["error", "always"], - "quotes": ["error", "double"], - "indent": ["error", "tab"], - "no-unused-vars": ["error"], - "no-tabs":["error",{"allowIndentationTabs":true}], - "no-console":["warn",{"allow":["error"]}] - } -} \ No newline at end of file diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml new file mode 100644 index 0000000..aaa1a86 --- /dev/null +++ b/.github/workflows/docker.yml @@ -0,0 +1,61 @@ +name: Create and publish a Docker image +# This workflow uses actions that are not certified by GitHub. +# They are provided by a third-party and are governed by +# separate terms of service, privacy policy, and support +# documentation. +on: + push: + branches: [master] + paths-ignore: + - '.github/**' + - 'images/' + - '*.md' + + workflow_dispatch: + +env: + # Use docker.io for Docker Hub if empty + REGISTRY: ghcr.io + # github.repository as / + IMAGE_NAME: ${{ github.repository }} + +jobs: + build-and-push-image: + runs-on: ubuntu-latest + permissions: + packages: write + contents: read + steps: + + - name: Setup + uses: actions/setup-node@v3 + + - name: Checkout + uses: actions/checkout@v3 + + - run: yarn install --immutable + + - run: yarn build + + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@v4 + with: + # list of Docker images to use as base name for tags + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + + - name: Login to GHCR + uses: docker/login-action@v2 + with: + registry: ${{ env.REGRISTRY }} + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build and push Docker image + uses: docker/build-push-action@v3 + with: + platforms: linux/amd64,linux/arm64,linux/arm/v7 + context: . + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} diff --git a/Dockerfile b/Dockerfile index ce9d8ba..a296876 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,9 +1,8 @@ -FROM node:12.18.3-alpine +FROM node:16.17.1-alpine RUN apk add ffmpeg COPY . /app WORKDIR /app -RUN npm install --only=production -RUN npm run postinstall +RUN yarn install --production -CMD node parseENV.js && npm run start \ No newline at end of file +CMD yarn start:prod \ No newline at end of file