Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into refactor/leverage-doc…
Browse files Browse the repository at this point in the history
…ker-compose
  • Loading branch information
lucatume committed Mar 21, 2023
2 parents 0c3362e + 4463348 commit 12d8d6a
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 1 deletion.
27 changes: 27 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,33 @@ If you want to know which version `slic` is pointed at, you can always call:

`slic composer get-version`

### Installing private packages with composer

If you need to install a private composer package, configure the [COMPOSER_AUTH](https://getcomposer.org/doc/03-cli.md#composer-auth) environment variable. For example, to install a package from a private GitHub repository:

> Note: You may need to create a [Personal Access Token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token).
```shell
export COMPOSER_AUTH='{"github-oauth": {"github.com": "YOUR_TOKEN_HERE"}}'
```

Then, restart slic and try again:

```shell
slic restart; slic composer update
```

Or, in a GitHub Action, for example:

```yaml
jobs:
test:
runs-on: ubuntu-latest

env:
COMPOSER_AUTH: '{"github-oauth": {"github.com": "${{ secrets.GH_BOT_TOKEN }}"}}'
```

### Customizing `slic`'s `.env` file

The `slic` CLI command leverages `.env.*` files to dictate its inner workings. It loads `.env.*` files in the following order, the later files overriding the earlier ones:
Expand Down
5 changes: 5 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
* Add the `dc` command to run Docker Compose commands in the stack.
* Support the `SLIC_DOCKER_COMPOSE_BIN` environment variable to allow for the use a different Docker Compose binary, the `docker compose` one is used by default.

## [1.2.3] - 2023-03-21

* Added - Pass through the [COMPOSER_AUTH](https://getcomposer.org/doc/03-cli.md#composer-auth) environment variable to the slic docker container to allow composer installs for private or otherwise protected dependencies. Especially useful when running in GitHub Actions.
* Added - The PHP exif extension to the slic container to allow `slic composer install` commands to succeed when this extension is required.

## [1.2.2] - 2023-02-24

* Change - No longer build gd in the slick docker container with AVIF, fixing external dependency on the currently down code.videolan.org, and speeding up builds - [more info](https://github.com/mlocati/docker-php-extension-installer#configuration).
Expand Down
2 changes: 1 addition & 1 deletion containers/slic/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ RUN chmod a+rx /usr/local/bin/wp
# The mlocati/docker-php-extension-installer will install PHP extensions setting up requirements correctly and cleaning up after.
ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/
RUN chmod a+x /usr/local/bin/install-php-extensions && \
install-php-extensions xdebug pdo pdo_mysql mysqli zip uopz pcntl sockets intl
install-php-extensions xdebug pdo pdo_mysql mysqli zip uopz pcntl sockets intl exif

RUN if [ ${IPE_GD_WITHOUTAVIF} = true ]; then \
IPE_GD_WITHOUTAVIF=1 install-php-extensions gd; \
Expand Down
1 change: 1 addition & 0 deletions slic-stack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ services:
wordpress:
condition: service_healthy
environment:
COMPOSER_AUTH: "${COMPOSER_AUTH:-}"
COMPOSER_CACHE_DIR: "/composer-cache"
# Set these values to allow the container to look wordpress up.
WORDPRESS_DB_USER: root
Expand Down

0 comments on commit 12d8d6a

Please sign in to comment.