Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker image for even easier local deployment #23

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file removed .DS_Store
Binary file not shown.
5 changes: 5 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
docker-compose.yaml
Dockerfile
.gitignore
LICENSE
README.md
50 changes: 50 additions & 0 deletions .github/workflows/docker.yaml
Original file line number Diff line number Diff line change
@@ -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 }}
14 changes: 14 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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
35 changes: 35 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
8 changes: 8 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
version: '3.7'
services:

web:
image: ghcr.io/actionretro/frogfind:main
ports:
- 8080:8080
restart: unless-stopped