🚀 Adjust docker files (#16)

This commit is contained in:
Manuel 2022-12-19 21:21:04 +01:00 committed by GitHub
parent 73d36ae1f3
commit 2f6de52f7b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 76 additions and 27 deletions

View File

@ -1,6 +1,16 @@
docs
src
test
images
docs
node_modules
package-lock.json
yarn.lock
Dockerfile
yarn.lock
.yarn
.vscode
.github
*.env
*.gitignore
.yarnrc.yml
.nest-cli.json
.dockerignore

View File

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

61
.github/workflows/docker.yml vendored Normal file
View File

@ -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 <account>/<repo>
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 }}

View File

@ -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
CMD yarn start:prod