diff --git a/.DS_Store b/.DS_Store deleted file mode 100644 index 18de60d..0000000 Binary files a/.DS_Store and /dev/null differ diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..10f714d --- /dev/null +++ b/.dockerignore @@ -0,0 +1,5 @@ +docker-compose.yaml +Dockerfile +.gitignore +LICENSE +README.md diff --git a/.github/workflows/docker.yaml b/.github/workflows/docker.yaml new file mode 100644 index 0000000..c00984d --- /dev/null +++ b/.github/workflows/docker.yaml @@ -0,0 +1,50 @@ +on: + # Triggers the workflow on push or pull request events but only for the master branch + push: + branches: [ main, dev ] + + release: + types: + - "created" + - "edited" + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Docker meta + id: meta + uses: docker/metadata-action@v3 + with: + images: | + ghcr.io/${{ github.repository_owner }}/frogfind + tags: | + type=ref,event=pr + type=ref,event=branch + type=ref,event=tag + type=sha + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + - name: Login to ghcr.io + if: ${{ github.event_name != 'pull_request' }} + uses: docker/login-action@v1 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ github.token }} + - name: Build and push + uses: docker/build-push-action@v2 + with: + context: . + platforms: linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64 + push: ${{ github.event_name != 'pull_request' }} + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..c771230 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,14 @@ +FROM composer:2.6.5 AS composer + +# Copying the source directory and install the dependencies with composer +COPY . /app + +# Run composer install to install the dependencies +RUN composer install \ + --optimize-autoloader \ + --no-interaction \ + --no-progress + +# Continue stage build with the desired image and copy the source including the dependencies downloaded by composer +FROM trafex/php-nginx:3.4.0 +COPY --chown=nginx --from=composer /app /var/www/html diff --git a/README.md b/README.md index 2d39484..5013515 100644 --- a/README.md +++ b/README.md @@ -2,3 +2,38 @@ Source for the FrogFind search engine for vintage computers Love the frog. Be the frog. + +## Selfhosted Usage +### Docker +**Installation** + +1. Install Docker and docker-compose +1. Create directory, in that directory create `docker-compose.yaml` file with content + ``` + version: '3.7' + services: + + web: + image: ghcr.io/actionretro/frogfind:main + ports: + - 8080:8080 + restart: unless-stopped + ``` +1. Run `docker-compose up -d` in directory where you created `docker-compose.yaml` +1. After a minute (depends on your internet speed), you should be able to access FrogFind on port 8080 + +Alternatively, you can just use `docker run`. +``` +docker run -p 8080:8080 ghcr.io/actionretro/frogfind:main +``` + +**Update** + +To update image, run in directory `docker-compose up -d --pull`. It will try to pull latest image. + +### Just a regular plain server +* You need to have some kind of webserver - Apache2/nginx and PHP installed. You also need Composer installed. + +1. Upload files from this repository to your server +2. On your server, in the webroot, run `composer install` to install required packages +3. Done, visit your website \ No newline at end of file diff --git a/docker-compose.yaml b/docker-compose.yaml new file mode 100644 index 0000000..eaa2240 --- /dev/null +++ b/docker-compose.yaml @@ -0,0 +1,8 @@ +version: '3.7' +services: + + web: + image: ghcr.io/actionretro/frogfind:main + ports: + - 8080:8080 + restart: unless-stopped