<commit_before>version: "3.4"

services:
  frontend:
    image: node:16.15.1@sha256:6155ff062c403e99c1da7c317710c5c838c1e060f526d98baea6ee921ca61729
    container_name: 'ecamp3-frontend'
    ports:
      - '3000:3000'
      - '9229:9229' # jest debug 
    stdin_open: true
    tty: true
    user: ${USER_ID:-1000}
    volumes:
      - ./frontend:/app:delegated
      - ./common:/common:delegated
      - ./.cache/npm:/home/node/.npm
      - ./.cache/cypress:/home/node/.cache/Cypress
    working_dir: /app
    command: ./docker-setup.sh
    environment:
      - NODE_ENV=development
      - NPM_CONFIG_UPDATE_NOTIFIER=false
      - NPM_CONFIG_CACHE=/home/node/.npm
      - CI=${CI}
      - CYPRESS_CACHE_FOLDER=/home/node/.cache/Cypress

  php:
    image: ecamp/ecamp3-api
    build:
      context: ./api
      target: api_platform_php_dev
      cache_from:
        - ecamp/ecamp3-api
    container_name: 'ecamp3-api'
    depends_on:
      - database
      - docker-host
    restart: unless-stopped
    volumes:
      - ./.caddy/php-socket:/var/run/php
      - ./api:/srv/api:rw,cached
      - ./api/docker/php/conf.d/api-platform.dev.ini:/usr/local/etc/php/conf.d/api-platform.ini
      - ./api/docker/php/docker-entrypoint.sh:/usr/local/bin/docker-entrypoint
      - ./.cache/composer:/tmp/composer/cache
    environment:
      APP_ENV: dev
      DATA_MIGRATIONS_DIR: dev-data
      # See https://docs.docker.com/docker-for-mac/networking/#i-want-to-connect-from-a-container-to-a-service-on-the-host
      # See https://github.com/docker/for-linux/issues/264
      # The `remote_host` below may optionally be replaced with `remote_connect_back`
      # XDEBUG_MODE required for step debugging
      XDEBUG_MODE: ${XDEBUG_MODE}
      # default port for Xdebug 3 is 9003
      # idekey=VSCODE if you are debugging with VSCode
      XDEBUG_CONFIG: ${XDEBUG_CONFIG}
      # This should correspond to the server declared in PHPStorm `Preferences | Languages & Frameworks | PHP | Servers`
      # Then PHPStorm will use the corresponding path mappings
      PHP_IDE_CONFIG: serverName=localhost
    healthcheck:
      interval: 10s
      timeout: 3s
      retries: 3
      start_period: 30s
    user: ${USER_ID:-1000}

  caddy:
    image: ecamp/ecamp3-caddy
    build:
      context: ./api
      target: api_platform_caddy
      cache_from:
        - ecamp/ecamp3-caddy
    container_name: 'ecamp3-caddy'
    depends_on:
      - php
    environment:
      SERVER_NAME: ${SERVER_NAME:-localhost:3001, localhost:3443, caddy:3001}
      MERCURE_PUBLISHER_JWT_KEY: ${MERCURE_PUBLISHER_JWT_KEY:-!ChangeMe!}
      MERCURE_SUBSCRIBER_JWT_KEY: ${MERCURE_SUBSCRIBER_JWT_KEY:-!ChangeMe!}
      MERCURE_EXTRA_DIRECTIVES: demo
    ports:
      # HTTP
      - target: 3001
        published: 3001
        protocol: tcp
      # HTTPS
      - target: 3443
        published: 3443
        protocol: tcp
      # HTTP/3
      - target: 3443
        published: 3443
        protocol: udp
    restart: unless-stopped
    user: ${USER_ID:-1000}
    volumes:
      - ./.caddy/php-socket:/var/run/php
      - ./.caddy/data:/data
      - ./.caddy/config-cache:/config
      - ./api/docker/caddy/Caddyfile:/etc/caddy/Caddyfile:ro
      - ./api/public:/srv/api/public:ro

  print:
    image: node:16.15.1@sha256:6155ff062c403e99c1da7c317710c5c838c1e060f526d98baea6ee921ca61729
    container_name: 'ecamp3-print'
    ports:
      - '3003:3003'
    user: ${USER_ID:-1000}
    volumes:<commit_msg>Bind mount .prettierrc into the container<commit_after>version: "3.4"

services:
  frontend:
    image: node:16.15.1@sha256:6155ff062c403e99c1da7c317710c5c838c1e060f526d98baea6ee921ca61729
    container_name: 'ecamp3-frontend'
    ports:
      - '3000:3000'
      - '9229:9229' # jest debug
    stdin_open: true
    tty: true
    user: ${USER_ID:-1000}
    volumes:
      - ./.prettierrc:/.prettierrc
      - ./frontend:/app:delegated
      - ./common:/common:delegated
      - ./.cache/npm:/home/node/.npm
      - ./.cache/cypress:/home/node/.cache/Cypress
    working_dir: /app
    command: ./docker-setup.sh
    environment:
      - NODE_ENV=development
      - NPM_CONFIG_UPDATE_NOTIFIER=false
      - NPM_CONFIG_CACHE=/home/node/.npm
      - CI=${CI}
      - CYPRESS_CACHE_FOLDER=/home/node/.cache/Cypress

  php:
    image: ecamp/ecamp3-api
    build:
      context: ./api
      target: api_platform_php_dev
      cache_from:
        - ecamp/ecamp3-api
    container_name: 'ecamp3-api'
    depends_on:
      - database
      - docker-host
    restart: unless-stopped
    volumes:
      - ./.caddy/php-socket:/var/run/php
      - ./api:/srv/api:rw,cached
      - ./api/docker/php/conf.d/api-platform.dev.ini:/usr/local/etc/php/conf.d/api-platform.ini
      - ./api/docker/php/docker-entrypoint.sh:/usr/local/bin/docker-entrypoint
      - ./.cache/composer:/tmp/composer/cache
    environment:
      APP_ENV: dev
      DATA_MIGRATIONS_DIR: dev-data
      # See https://docs.docker.com/docker-for-mac/networking/#i-want-to-connect-from-a-container-to-a-service-on-the-host
      # See https://github.com/docker/for-linux/issues/264
      # The `remote_host` below may optionally be replaced with `remote_connect_back`
      # XDEBUG_MODE required for step debugging
      XDEBUG_MODE: ${XDEBUG_MODE}
      # default port for Xdebug 3 is 9003
      # idekey=VSCODE if you are debugging with VSCode
      XDEBUG_CONFIG: ${XDEBUG_CONFIG}
      # This should correspond to the server declared in PHPStorm `Preferences | Languages & Frameworks | PHP | Servers`
      # Then PHPStorm will use the corresponding path mappings
      PHP_IDE_CONFIG: serverName=localhost
    healthcheck:
      interval: 10s
      timeout: 3s
      retries: 3
      start_period: 30s
    user: ${USER_ID:-1000}

  caddy:
    image: ecamp/ecamp3-caddy
    build:
      context: ./api
      target: api_platform_caddy
      cache_from:
        - ecamp/ecamp3-caddy
    container_name: 'ecamp3-caddy'
    depends_on:
      - php
    environment:
      SERVER_NAME: ${SERVER_NAME:-localhost:3001, localhost:3443, caddy:3001}
      MERCURE_PUBLISHER_JWT_KEY: ${MERCURE_PUBLISHER_JWT_KEY:-!ChangeMe!}
      MERCURE_SUBSCRIBER_JWT_KEY: ${MERCURE_SUBSCRIBER_JWT_KEY:-!ChangeMe!}
      MERCURE_EXTRA_DIRECTIVES: demo
    ports:
      # HTTP
      - target: 3001
        published: 3001
        protocol: tcp
      # HTTPS
      - target: 3443
        published: 3443
        protocol: tcp
      # HTTP/3
      - target: 3443
        published: 3443
        protocol: udp
    restart: unless-stopped
    user: ${USER_ID:-1000}
    volumes:
      - ./.caddy/php-socket:/var/run/php
      - ./.caddy/data:/data
      - ./.caddy/config-cache:/config
      - ./api/docker/caddy/Caddyfile:/etc/caddy/Caddyfile:ro
      - ./api/public:/srv/api/public:ro

  print:
    image: node:16.15.1@sha256:6155ff062c403e99c1da7c317710c5c838c1e060f526d98baea6ee921ca61729
    container_name: 'ecamp3-print'
    ports:
      - '3003:3003'
    user: ${USER_ID:-1000}
    volumes:
      - ./.prettierrc:/.prettierrc
{'fraction_non_alphanumeric': 0.11743772241992882, 'fraction_numerical': 0.05722419928825623, 'mean_word_length': 2.4073714839961204, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 16, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7105208', 'n_tokens_mistral': 2855, 'n_tokens_neox': 2539, 'n_words': 406}