Skip to content

Commit

Permalink
build: allow for easier building different versions of images locally
Browse files Browse the repository at this point in the history
  • Loading branch information
EdieLemoine committed Sep 19, 2024
1 parent b3086ee commit 642cfce
Show file tree
Hide file tree
Showing 4 changed files with 71 additions and 16 deletions.
25 changes: 25 additions & 0 deletions .env → .env.template
Original file line number Diff line number Diff line change
@@ -1,3 +1,28 @@
###
# Image build arguments
###

# php-xd
PHP_XD_PHP_VERSION=8.1
PHP_XD_ALPINE_VERSION=""
PHP_XD_TYPE=""

# WordPress
WP_VERSION=6.5.3
WP_PHP_VERSION=7.4

# PrestaShop
PS_VERSION=8.1.0
PS_PHP_VERSION=8.1

# Shopware
SW_VERSION=6.5.0.0
SW_PHP_VERSION=8.1

###
# Docker variables
###

DOCKER_CACHE_TYPE=local
DOCKER_CACHE_SOURCE=src=.docker/cache,tag=
DOCKER_CACHE_TARGET=dest=.docker/cache,tag=
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -133,3 +133,4 @@ $RECYCLE.BIN/
# End of https://www.toptal.com/developers/gitignore/api/yarn

node_modules/
.env
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,22 @@

Docker images we use in our open source projects. All images have `linux/amd64` and `linux/arm64` variants.

## Usage

To build the images using the provided root `docker-compose.yml`, first create `.env`:

```bash
cp .env.example .env
```

You can change the variables in the `.env` file to change which versions of the images are built.

After that, use Docker compose to build the images:

```bash
docker compose build
```

## Contents

## php-xd
Expand Down
45 changes: 29 additions & 16 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,33 @@
services:
###
# Main php container
#
# This container runs the php-fpm process and serves WordPress.
#
# Requires the db container to be running.
#
# Contains:
# - php-fpm, xdebug, composer
# - WordPress installation (in volume web-data)
# - Various tools: zsh, vim
#
# See https://github.com/myparcelnl/docker-images/pkgs/container/wordpress
##
php-xd:
image: ghcr.io/myparcelnl/php-xd:${PHP_XD_PHP_VERSION}${PHP_XD_TYPE}-alpine${PHP_XD_ALPINE_VERSION}
build:
context: images/php-xd
args:
ALPINE_VERSION: ${PHP_XD_ALPINE_VERSION}
PHP_VERSION: ${PHP_XD_PHP_VERSION}
TYPE: ${PHP_XD_TYPE}

wordpress:
image: ghcr.io/myparcelnl/wordpress:6.3-php7.4
image: ghcr.io/myparcelnl/wordpress:${WP_VERSION}-php${WP_PHP_VERSION}
build:
context: images/wordpress
dockerfile: Dockerfile
args:
WP_VERSION: ${WP_VERSION}
PHP_VERSION: ${WP_PHP_VERSION}

prestashop:
image: ghcr.io/myparcelnl/prestashop:${PS_VERSION}-php${PS_PHP_VERSION}
build:
context: images/prestashop
args:
PS_VERSION: ${PS_VERSION}
PHP_VERSION: ${PS_PHP_VERSION}

shopware:
image: ghcr.io/myparcelnl/shopware:${SW_VERSION}-php${SW_PHP_VERSION}
build:
context: images/shopware
args:
SW_VERSION: ${SW_VERSION}
PHP_VERSION: ${SW_PHP_VERSION}

0 comments on commit 642cfce

Please sign in to comment.