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

dev: add development container to docker-compose.yaml #62

Merged
merged 2 commits into from
Mar 8, 2024
Merged
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
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
**
24 changes: 24 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# renovate: datasource=docker depName=php
ARG PHP_VERSION=8.3.2

# renovate: datasource=docker depName=alpine
ARG ALPINE_VERSION=3.18

FROM php:${PHP_VERSION}-alpine${ALPINE_VERSION}

# php extensions installer: https://github.com/mlocati/docker-php-extension-installer
COPY --from=mlocati/php-extension-installer --link /usr/bin/install-php-extensions /usr/local/bin/

RUN set -eux; \
install-php-extensions pdo_mysql mongodb

# https://getcomposer.org/doc/03-cli.md#composer-allow-superuser
ENV PATH="${PATH}:/root/.composer/vendor/bin"
ENV COMPOSER_HOME=/tmp/composer
ENV COMPOSER_CACHE_DIR=/tmp/composer/cache
RUN mkdir -p /tmp/composer/cache
RUN chmod ugo+w /tmp/composer/cache

COPY --from=composer /usr/bin/composer /usr/bin/composer

CMD ["php"]
13 changes: 13 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,19 @@ version: '3.1'

# To keep in sync with .gitHub/workflows/tests.yaml
services:
php:
build: .
volumes:
- .:/app
- ./.cache/composer:/tmp/composer/cache:delegated
working_dir: /app
environment:
- DATABASE_URL=mysql://root:password@mysql/hautelook_alice_bundle
profiles:
- php
user: ${USER_ID:-1000}
network_mode: host

mysql:
image: mysql:8.0
platform: linux/amd64
Expand Down
Loading