diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..80bf43b --- /dev/null +++ b/.dockerignore @@ -0,0 +1,2 @@ +.git* +docker-compose.yml diff --git a/.github/workflows/build-image.yml b/.github/workflows/build-image.yml new file mode 100644 index 0000000..5ffd03f --- /dev/null +++ b/.github/workflows/build-image.yml @@ -0,0 +1,51 @@ +name: Build docker image + +on: + # Runs on pushes targeting the default branch + push: + branches: ["buildx","buildx-semver", "main"] # replace with ["main"] + tags: ['*'] + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Container Registry +permissions: + contents: read + packages: write + +jobs: + docker: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Generate Docker metadata + id: meta + uses: docker/metadata-action@v4 + with: + images: | + ghcr.io/${{ github.repository }} + tags: | + type=ref,event=branch + type=semver,pattern={{version}} + type=semver,pattern={{major}}.{{minor}} + flavor: | + latest=true + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + - name: Login to GitHub Container Registry + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Build and push + uses: docker/build-push-action@v4 + with: + push: true + platforms: linux/amd64,linux/arm64 + labels: ${{ steps.meta.outputs.labels }} + tags: ${{ steps.meta.outputs.tags }} diff --git a/Dockerfile b/Dockerfile index 55e0164..58b168c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,6 @@ FROM node:16-alpine -RUN apk add git -RUN git clone https://github.com/Metastem/wikiless.git WORKDIR /wikiless +COPY . /wikiless RUN npm install --no-optional COPY config.js.template config.js CMD npm start