From d05686daaf38963bad2cb7f4aa1d5dc1c8d3dcec Mon Sep 17 00:00:00 2001 From: chrissawyerfan4 <126926647+chrissawyerfan4@users.noreply.github.com> Date: Sat, 13 Apr 2024 04:03:13 +0200 Subject: [PATCH] Make Podman installation work - Specify registries in Dockerfiles such that Podman can resolve the dependencies - Add a name for the PHP container, such that the commands work when using `exec -it linkace-php` - Mention in CONTRIBUTING.md that Podman works also - Update the PHP version in CONTRIBUTING.md as proposed in https://github.com/Kovah/LinkAce/discussions/746#discussioncomment-9101259 --- CONTRIBUTING.md | 5 +++-- docker-compose.production-simple.yml | 4 ++-- docker-compose.production.yml | 8 ++++---- docker-compose.yml | 9 +++++---- resources/docker/dockerfiles/development.Dockerfile | 2 +- resources/docker/dockerfiles/release-base.Dockerfile | 2 +- .../dockerfiles/release-multiplatform-simple.Dockerfile | 2 +- .../docker/dockerfiles/release-multiplatform.Dockerfile | 2 +- 8 files changed, 18 insertions(+), 16 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index bd7f4871..edca73eb 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -24,12 +24,13 @@ starting to code. ### Minimum Requirements -* [Docker](https://www.docker.com/products/docker-desktop) _or_ PHP 7.4 +* [Docker](https://www.docker.com/products/docker-desktop)/[Podman](https://podman.io/docs/installation) _or_ a [currently-supported PHP version](https://www.php.net/supported-versions.php) + * For Podman, you also need to `apt`, `dnf`, or otherwise install [`podman-compose`](https://github.com/containers/podman-compose) * [Node](https://nodejs.org/en/) (16 LTS) ### 1. Basic Setup -The following steps assume that you are using Docker for development, which I highly encourage. If you use other ways to work with PHP projects you must adapt the commands to your system. Clone the repository to your machine and run the following commands to start the Docker container system: +The following steps assume that you are using Docker or Podman for development, which I highly encourage. If you use other ways to work with PHP projects you must adapt the commands to your system. If you want to use Podman, simply replace the word `docker` with `podman` in each command. Clone the repository to your machine and run the following commands to start the Docker container system: ```bash cp .env.docker .env diff --git a/docker-compose.production-simple.yml b/docker-compose.production-simple.yml index ba0f9512..7a337744 100644 --- a/docker-compose.production-simple.yml +++ b/docker-compose.production-simple.yml @@ -4,7 +4,7 @@ services: # --- MariaDB db: - image: mariadb:11.2 + image: docker.io/library/mariadb:11.2 restart: unless-stopped command: mariadbd --character-set-server=utf8mb4 --collation-server=utf8mb4_bin environment: @@ -17,7 +17,7 @@ services: # --- LinkAce Image with PHP and nginx app: - image: linkace/linkace:simple + image: docker.io/library/linkace/linkace:simple restart: unless-stopped depends_on: - db diff --git a/docker-compose.production.yml b/docker-compose.production.yml index 9b8a5596..f4a1c149 100644 --- a/docker-compose.production.yml +++ b/docker-compose.production.yml @@ -4,7 +4,7 @@ services: # --- MariaDB db: - image: mariadb:11.2 + image: docker.io/library/mariadb:11.2 restart: unless-stopped command: mariadbd --character-set-server=utf8mb4 --collation-server=utf8mb4_bin environment: @@ -17,7 +17,7 @@ services: # --- LinkAce Image with PHP app: - image: linkace/linkace:latest + image: docker.io/library/linkace/linkace:latest restart: unless-stopped depends_on: - db @@ -29,7 +29,7 @@ services: # --- nginx nginx: - image: bitnami/nginx:1.24 + image: docker.io/bitnami/nginx:1.24 restart: unless-stopped ports: - "0.0.0.0:80:8080" @@ -45,7 +45,7 @@ services: # --- Redis redis: - image: bitnami/redis:7.2 + image: docker.io/bitnami/redis:7.2 restart: unless-stopped environment: - REDIS_PASSWORD=${REDIS_PASSWORD} diff --git a/docker-compose.yml b/docker-compose.yml index db0e7a71..3725b604 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -5,7 +5,7 @@ services: # --- MariaDB db: - image: mariadb:11.2 + image: docker.io/library/mariadb:11.2 command: mariadbd --character-set-server=utf8mb4 --collation-server=utf8mb4_bin environment: - MYSQL_ROOT_PASSWORD=${DB_PASSWORD} @@ -18,7 +18,7 @@ services: - linkace-db:/var/lib/mysql pg-db: - image: postgres:14 + image: docker.io/library/postgres:14 environment: - POSTGRES_PASSWORD=${DB_PASSWORD} - POSTGRES_USER=${DB_USERNAME} @@ -30,6 +30,7 @@ services: # --- PHP php: + container_name: linkace-php build: context: . dockerfile: ./resources/docker/dockerfiles/development.Dockerfile @@ -41,7 +42,7 @@ services: # --- nginx nginx: - image: bitnami/nginx:1.25 + image: docker.io/bitnami/nginx:1.25 ports: - "80:8080" depends_on: @@ -52,7 +53,7 @@ services: # --- Redis redis: - image: bitnami/redis:7.2 + image: docker.io/bitnami/redis:7.2 environment: - REDIS_PASSWORD=${REDIS_PASSWORD} ports: diff --git a/resources/docker/dockerfiles/development.Dockerfile b/resources/docker/dockerfiles/development.Dockerfile index 75049fd1..9e851bb7 100644 --- a/resources/docker/dockerfiles/development.Dockerfile +++ b/resources/docker/dockerfiles/development.Dockerfile @@ -1,7 +1,7 @@ # DOCKERFILE DEVELOPMENT # Installs MySQL Client for database exports, xDebug with PCov and Composer -FROM php:8.1.10-fpm +FROM docker.io/library/php:8.1.10-fpm WORKDIR /app RUN apt-get update && apt-get install -y \ diff --git a/resources/docker/dockerfiles/release-base.Dockerfile b/resources/docker/dockerfiles/release-base.Dockerfile index c522b3ba..c308e7d6 100644 --- a/resources/docker/dockerfiles/release-base.Dockerfile +++ b/resources/docker/dockerfiles/release-base.Dockerfile @@ -1,4 +1,4 @@ -FROM php:8.3-fpm-alpine +FROM docker.io/library/php:8.3-fpm-alpine # Install package and PHP dependencies RUN apk add --no-cache mariadb-client postgresql postgresql-dev sqlite zip libzip-dev; \ diff --git a/resources/docker/dockerfiles/release-multiplatform-simple.Dockerfile b/resources/docker/dockerfiles/release-multiplatform-simple.Dockerfile index 41019746..f5653754 100644 --- a/resources/docker/dockerfiles/release-multiplatform-simple.Dockerfile +++ b/resources/docker/dockerfiles/release-multiplatform-simple.Dockerfile @@ -1,5 +1,5 @@ # DOCKERFILE RELEASE -FROM linkace/linkace:latest +FROM docker.io/library/linkace/linkace:latest # Install nginx and supervisor RUN apk add --no-cache nginx supervisor diff --git a/resources/docker/dockerfiles/release-multiplatform.Dockerfile b/resources/docker/dockerfiles/release-multiplatform.Dockerfile index 3400727e..2d26b535 100644 --- a/resources/docker/dockerfiles/release-multiplatform.Dockerfile +++ b/resources/docker/dockerfiles/release-multiplatform.Dockerfile @@ -2,7 +2,7 @@ # ================================ # PHP Dependency Setup -FROM linkace/base-image:php-8.3-alpine AS builder +FROM docker.io/library/linkace/base-image:php-8.3-alpine AS builder WORKDIR /app # Pull composer and install required packages