Sign inSign up

signifly/exp-php7.3

By signifly

•Updated almost 7 years ago

Image
0

816

signifly/exp-php7.3 repository overview

Example usage of this base image in projects:

FROM exp-php7.3:latest

USER www-data:www-data

RUN composer config --global --auth http-basic.repo.packagist.com token XXX
COPY --chown=www-data:www-data composer.json composer.lock $WORK_DIR/
RUN /tools/install-dependencies.sh
COPY --chown=www-data:www-data . $WORK_DIR/
RUN /tools/install-dependencies.sh

USER root

docker-compose.yml:

  app:
    container_name: XXX-api
    build: .
    environment:
      MYSQL_HOST: mysql
      OPCACHE_VERSION: 3
    labels:
      traefik.port: 80
      traefik.frontend.rule: Host:dev.signifly.io
    volumes:
      - ./:/var/www/html:delegated
      - ~/.composer/cache/:/.composer:cached

  horizon:
    container_name: XXX-api-horizon
    build: .
    command: "horizon"
    environment:
      SKIP_MIGRATIONS: 1
      DEV: 1
    volumes:
      - ./:/var/www/html:delegated
      - ~/.composer/cache/:/.composer:cached

OPCACHE_VERSION can be set to 2 or 3 depending on which version is used. Defaults to "3".

If SKIP_MIGRATIONS env var is set to anything, the container wont run migrations on start up

If SKIP_DEPENDENCIES env var is set to anything, the container wont run composer install and dump autoloader on start up

If APP_ENV is set to production, it'll install dependencies with --prefer-dist --no-dev as well as optimize and cache various things. If DEV is set to 1, it'll ensure composer dev dependencies are installed and all caches cleared. DEV can be set to override this and force installation of dev dependencies as well as clear caches and optimizations.

If WAIT_FOR_MYSQL env var is set, the container will halt the init process until $DB_HOST is available on $DB_PORT (loaded from .env).

command in docker-compose.yml can be set to any of [api, horizon, scheduler, websocket]. Any other command will run that command on the shell.

Tag summary

Content type

Image

Digest

Size

72.1 MB

Last updated

almost 7 years ago

docker pull signifly/exp-php7.3