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

Please add docker-compose #71

Open
darakanoit opened this issue Aug 29, 2022 · 3 comments
Open

Please add docker-compose #71

darakanoit opened this issue Aug 29, 2022 · 3 comments
Assignees
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@darakanoit
Copy link

Add docker-compose to the repositories to quickly raise the project as in keeper

@akserikawa
Copy link

+1

@butschster butschster added enhancement New feature or request help wanted Extra attention is needed labels Dec 17, 2022
@drIceman
Copy link

I have something like this

version: '3.9'

services:
  php-prepare:
    build:
      context: ${PWD}/php
    image: spiral-php
    pull_policy: never
    user: "1000:1000"
    volumes:
      - src_data:/var/www/html
    entrypoint:
      - bash
      - -c
    command:
      - "composer install && if [ ! -f rr ]; then composer run-script post-create-project-cmd; fi"

  php:
    restart: on-failure
    image: spiral-php
    pull_policy: never
    user: "1000:1000"
    volumes:
      - php_conf:/usr/local/etc/php/z_custom
      - src_data:/var/www/html
    ports:
      - "8080:8080"
    env_file:
      - src/.env
    environment:
      PHP_INI_SCAN_DIR: :/usr/local/etc/php/z_custom
      PHP_IDE_CONFIG: serverName=spiral.local
    networks:
      default:
    depends_on:
      php-prepare:
        condition: service_completed_successfully
      rabbitmq:
        condition: service_started
      mailhog:
        condition: service_started

  rabbitmq:
    restart: on-failure
    image: rabbitmq:management-alpine
    hostname: rabbitmq
    env_file:
      - src/.env
    ports:
      - "15672:15672"

  mailhog:
    restart: on-failure
    image: mailhog/mailhog
    ports:
      - "8025:8025"

volumes:
  src_data:
    driver: local
    driver_opts:
      type: none
      device: ${PWD}/src
      o: bind
  php_conf:
    driver: local
    driver_opts:
      type: none
      device: ${PWD}/php/conf.d
      o: bind

networks:
  default:

And Dockerfile in ./php like this

FROM php:8.2-cli-bullseye

RUN set -xe \
    && apt-get update \
    && apt-get -y --no-install-recommends install \
        unzip \
    && docker-php-ext-install \
        opcache \
        sockets \
    && pecl install \
    	xdebug \
    && docker-php-ext-enable \
        opcache \
        sockets \
    && php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" \
    && php -r "if (hash_file('sha384', 'composer-setup.php') === '55ce33d7678c5a611085589f1f3ddf8b3c52d662cd01d4ba75c0ee0459970c2200a51f492d557530c71c15d8dba01eae') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;" \
    && php composer-setup.php --install-dir=/bin --filename=composer --version=2.5.4 \
    && php -r "unlink('composer-setup.php');" \
    && apt-get autoremove -y \
    && apt-get clean \
    && rm -rf /var/lib/apt/lists/*

WORKDIR /var/www/html

EXPOSE 8080

CMD ["./rr", "serve"]

@darakanoit
Copy link
Author

Is there any progress? It would be great if the installer gave docker-compose at the output.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
Status: Todo
Development

No branches or pull requests

4 participants