Skip to content
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
9 changes: 7 additions & 2 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ name: Publish Docker image

on:
# Schedule daily at 12am
schedule:
- cron: '0 0 * * *'
schedule:
- cron: '0 0 * * *' # nightly develop
- cron: '0 0 * * 0' # weekly release-candidate (Sundays)
- cron: '0 0 1 * *' # monthly stable (1st of each month)
# Triggers the workflow on push events but only for the main branch
push:
branches: [main]
Expand Down Expand Up @@ -46,6 +48,7 @@ jobs:
ghcr.io/${{ github.repository }}

- name: STABLE - Build and push Docker images
if: github.event.schedule == '0 0 1 * *' || github.ref == 'refs/heads/main' || github.event_name == 'workflow_dispatch'
uses: docker/build-push-action@v5
with:
context: .
Expand All @@ -59,6 +62,7 @@ jobs:
cache-to: type=gha,scope=stable,mode=max

- name: DEVELOP - Build and push Docker images
if: github.event.schedule == '0 0 * * *' || github.ref == 'refs/heads/main' || github.event_name == 'workflow_dispatch'
uses: docker/build-push-action@v5
with:
context: .
Expand All @@ -72,6 +76,7 @@ jobs:
cache-to: type=gha,scope=develop,mode=max

- name: RELEASE-CANDIDATE - Build and push Docker images
if: github.event.schedule == '0 0 * * 0' || github.ref == 'refs/heads/main' || github.event_name == 'workflow_dispatch'
uses: docker/build-push-action@v5
with:
context: .
Expand Down
45 changes: 45 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# wish**this** Docker project
Building and maintaining this project is solely about the containerization of [wish**this**](https://github.com/wishthis/wishthis/). If you want to contribute to wishthis itself, take a look [here](https://github.com/wishthis/wishthis/?tab=readme-ov-file#trophy-contributing).

## Building and testing locally

If you contribute to this image, before making a pull request, you should build and run it locally. Here is a guide on how to do this.

### Prerequisites

- `docker` is installed in your development environment.
- `dockerd` the docker deamon is installed (and [started](https://docs.docker.com/config/daemon/start/))
- `buildx` is installed in your development environment.

Although it's possible to build packages without `dockerd` running, using [`buildah`](https://buildah.io/), the focus here is on [`buildx`](https://docs.docker.com/reference/cli/docker/buildx/). You're welcome to contribute with instructions for `buildah`.

### Building the docker image locally

1. Start the docker daemon if it's not already started: `sudo dockerd`
2. Run the build command:
```
docker buildx build --platform linux/amd64 -t wishthis-local --load .
```

* replace the platform (`linux/amd64`) if you're building on another platform
* replace `wishthis-local` with any name you would like to give your local image
* `--load .` loads the image into your local docker, so you can use it as a container image.

#### Building the docker image containing the _non-release_ versions wish**this**
- Follow the instructions above, but override the build arg: `WISHTHIS_GITBRANCH`. For example, you can build the _develop_ version:
```
docker buildx build --platform linux/amd64 -t wishthis-local-dev \
--build-arg WISHTHIS_GITBRANCH=develop --load .
```

This approach may also be used for other [branches of wish**this**](https://github.com/wishthis/wishthis/branches), including the [release-candidate](https://github.com/wishthis/wishthis/tree/release-candidate). Simply replace _develop_ in the above command with the proper branch name.

### Building for multiple architecures locally
1. Start the docker daemon if it's not already started: `sudo dockerd`
2. Create a builder-image `docker buildx create --name mybuilder --use --bootstrap` (see "Building with Buildx" [here](https://www.docker.com/blog/how-to-rapidly-build-multi-architecture-images-with-buildx/) for more details)
3. Run the build command: `docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v7 -t wishthis-local .`
* replace `wishthis-local` with any name you would like to give your local image
* NOTE: The build process is significantly longer than just building for your local architecture.

### Running the docker image locally
1. Follow the same steps as in [Docker : usage](./README.md#Docker-:-usage), replacing the image name `hiob/wishthis:stable` with your local container name, e.g. `wishthis-local`.
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ RUN chmod +x /usr/local/bin/entrypoint.sh

# Final image build
FROM php:8.2-apache-bullseye
ARG WISHTHIS_GITBRANCH
ENV WISHTHIS_GITBRANCH=$WISHTHIS_GITBRANCH

# Metadata
LABEL maintainer="hiob <50a7f360-a150-43e4-8aa0-5e837f6c061c@corbeille.xyz>"
Expand Down Expand Up @@ -103,4 +105,3 @@ USER www-data
# Entrypoint and default command
ENTRYPOINT ["sh", "/usr/local/bin/entrypoint.sh"]
CMD ["/usr/sbin/apache2ctl", "-D", "FOREGROUND"]

115 changes: 57 additions & 58 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,69 +1,68 @@
![wishthis logo](https://raw.githubusercontent.com/wishthis/wishthis/develop/src/assets/img/logo-readme.svg "wishthis logo")
![wish**this** logo](https://raw.githubusercontent.com/wishthis/wishthis/develop/src/assets/img/logo-readme.svg "wish**this** logo")

# wishthis - [Official docker image](https://hub.docker.com/r/hiob/wishthis)
[wishthis](https://wishthis.online/) is a simple, intuitive and modern wishlist platform to create, manage and view your wishes for any kind of occasion.
# wish**this** - [Official docker image](https://hub.docker.com/r/hiob/wishthis)
[wish**this**](https://wishthis.online/) is a simple, intuitive and modern wishlist platform to create, manage and view your wishes for any kind of occasion.

## wishthis : documentation and setup
Always refer you to [wishthis documentation](https://github.com/wishthis/wishthis/).
## wish**this** : documentation and setup
Always refer you to [wish**this** documentation](https://github.com/wishthis/wishthis/).

## Docker : usage
You can find support and an updated documentation on our [Github's repository](https://github.com/wishthis/docker/).
We host ours docker images on [Docker's hub](https://hub.docker.com/r/hiob/wishthis) or [ghcr.io](https://ghcr.io/wishthis/docker)

Three tags/images are avalaibles:
- **develop** : for Wishthis's [*develop branch*](https://github.com/wishthis/wishthis/tree/develop)
- **release-candidate** : for Wishthis's [*release-candidate branch*](https://github.com/wishthis/wishthis/tree/release-candidate) **RECOMMENDED**
- **stable** : for Wishthis's [*stable branch*](https://github.com/wishthis/wishthis/tree/stable)

### Docker-compose
Always refer you to [Docker compose documentation](https://docs.docker.com/compose/reference/).

Here a sample of [docker-compose.yml](sample/docker-compose.yml.sample). MySQL server isn't included in image, you should set it in another container :


```
version: '3.7'

services:
wishthis:
container_name: wishthis
restart: unless-stopped
image: hiob/wishthis:stable
environment:
- VIRTUAL_HOST=sub.domain.ext
ports:
- 80:80
volumes:
- ./config.php:/var/www/html/src/config/config.php
networks:
- wishthis

mariadb:
container_name: db
restart: unless-stopped
image: mariadb
environment:
MARIADB_ROOT_PASSWORD: rootpassword
MARIADB_DATABASE: databasename
MARIADB_USER: username
MARIADB_PASSWORD: userpassword
volumes:
- ./data:/var/lib/mysql
ports:
- 3306:3306
networks:
- wishthis

networks:
wishthis:
external: true
```
We host our docker images on [Docker's hub](https://hub.docker.com/r/hiob/wishthis) or [ghcr.io](https://ghcr.io/wishthis/docker)

Three tags/images are avalaible:
- **develop** : for Wish**this**'s [*develop branch*](https://github.com/wishthis/wishthis/tree/develop)
- **release-candidate** : for Wish**this**'s [*release-candidate branch*](https://github.com/wishthis/wishthis/tree/release-candidate) **RECOMMENDED**
- **stable** : for Wish**this**'s [*stable branch*](https://github.com/wishthis/wishthis/tree/stable)

### Docker-compose : wish**this** with MariaDB
Install docker-compose version 2. Example with apt: `sudo apt install docker-compose-v2`. Always refer to the [Docker compose documentation](https://docs.docker.com/compose/reference/).

Here a sample of [docker-compose.yml.sample](sample/docker-compose.yml.sample). MySQL/MariaDB server isn't included in image, you should set it in another container, this is done in the linked docker-compose sample.

1. Copy the [docker-compose.yml](sample/docker-compose.yml.sample) to a folder on your docker host, name it `docker-compose.yml`.
2. Edit the file and configure your MySQL compatible MariaDB's connection settings, by altering the values of `MARIADB_ROOT_PASSWORD`, `MARIADB_DATABASE`, `MARIADB_USER` and `MARIADB_PASSWORD`.
3. Copy [config-sample.php](https://github.com/wishthis/wishthis/blob/develop/src/config/config-sample.php) into a file called `config-sample.php` in the same folder as `docker-compose.yml`
4. Run `docker-compose up -d`

Wishthis will be available to http://localhost:80.

5. Follow the installation guide. Select MySQL and enter the values from the MariaDB configuration in your `docker-compose.yml`.

You can use a reverse proxy ([Nginx](https://www.nginx.com/),[ Traefik](https://doc.traefik.io/traefik/getting-started/quick-start/), [SWAG](https://docs.linuxserver.io/general/swag)...) to serve wishthis with is own (sub)domain name.

### Permanent configuration
At first launch, if you didn't create a Wishthis's configuration file by mounting a permanent volume, You will be invite to setup Wishthis and database.
### Docker-compose : wish**this** with SQLite
Install docker-compose version 2.
1. Copy the [docker-compose-sqlite.yml](sample/docker-compose-sqlite.yml) to a folder on your docker host, name it `docker-compose.yml`.
2. Copy [config-sample.php](https://github.com/wishthis/wishthis/blob/develop/src/config/config-sample.php) into a file called `config-sample.php` in the same folder as `docker-compose.yml`
3. Run `docker-compose up -d`

Wishthis will be available to http://localhost:80.

> **NOTE**: The SQLite database will reside inside the container in `/var/www/html/database.sqlite`. To make your database persistent between containers, you should extract the file to your docker host and then mount it as a volume. (see [docker-compose.yml example](sample/docker-compose-sqlite-dbvol.yml)). This extra step can be eliminated when [this issue](https://github.com/wishthis/wishthis/issues/232) has been resolved.

### Docker CLI : wish**this** with SQLite

1. Copy [config-sample.php](https://github.com/wishthis/wishthis/blob/develop/src/config/config-sample.php) into a file called `config-sample.php` in the same folder as `docker-compose.yml`
2. Run
```
docker run -d \
--name wishthis \
--restart unless-stopped \
-e VIRTUAL_HOST=sub.domain.ext \
-p 80:80 \
-v "$(pwd)/config/:/var/www/html/src/config/" \
hiob/wishthis:develop
```

To keep your database configuration permanent, mount a volume (see example above), create a file named `config.php` and copy the [`config-sample.php` from Github's repo](https://github.com/wishthis/wishthis/blob/develop/src/config/config-sample.php).
> **NOTE**: The SQLite database will reside inside the container in `/var/www/html/database.sqlite`. To make your database persistent between containers, you should extract the file to your docker host and then mount it as a volume. This extra step can be eliminated when [this issue](https://github.com/wishthis/wishthis/issues/232) has been resolved. To mount this extra file with the docker CLI also, the full command will be:
```
docker run -d \
--name wishthis \
--restart unless-stopped \
-e VIRTUAL_HOST=sub.domain.ext \
-p 80:80 \
-v "$(pwd)/config/:/var/www/html/src/config/" \
-v "$(pwd)/database.sqlite:/var/www/htmldatabase.sqlite" \
hiob/wishthis:develop
```
18 changes: 18 additions & 0 deletions sample/docker-compose-sqlite-dbvol.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
services:
wishthis:
container_name: wishthis
restart: unless-stopped
image: hiob/wishthis:stable
environment:
- VIRTUAL_HOST=sub.domain.ext
ports:
- 80:80
volumes:
- ./config/:/var/www/html/src/config/
- ./database.sqlite;/var/www/html/database.sqlite
networks:
- wishthis

networks:
wishthis:
external: false
17 changes: 17 additions & 0 deletions sample/docker-compose-sqlite.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
services:
wishthis:
container_name: wishthis
restart: unless-stopped
image: hiob/wishthis:stable
environment:
- VIRTUAL_HOST=sub.domain.ext
ports:
- 80:80
volumes:
- ./config/:/var/www/html/src/config/
networks:
- wishthis

networks:
wishthis:
external: false
6 changes: 2 additions & 4 deletions sample/docker-compose.yml.sample
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
version: '3.7'

services:
wishthis:
container_name: wishthis
Expand All @@ -10,7 +8,7 @@ services:
ports:
- 80:80
volumes:
- ./config.php:/var/www/html/src/config/config.php
- ./config/:/var/www/html/src/config/
networks:
- wishthis

Expand All @@ -32,4 +30,4 @@ services:

networks:
wishthis:
external: true
external: false