Skip to content

Instantly share code, notes, and snippets.

@danielpetrica
Last active May 14, 2022 18:03
Show Gist options
  • Save danielpetrica/6f9ffc316f00a11fb3e7eeb110703202 to your computer and use it in GitHub Desktop.
Save danielpetrica/6f9ffc316f00a11fb3e7eeb110703202 to your computer and use it in GitHub Desktop.

Revisions

  1. danielpetrica revised this gist May 14, 2022. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion docker-compose.yaml
    Original file line number Diff line number Diff line change
    @@ -3,7 +3,7 @@ version: "3"
    services:
    web:
    container_name: project_web
    image: docker pull ghcr.io/danielpetrica/php:7.4.10
    image: ghcr.io/danielpetrica/php:7.4.10
    #build:
    # context: ./
    # dockerfile: Dockerfile
  2. danielpetrica revised this gist May 14, 2022. 1 changed file with 4 additions and 3 deletions.
    7 changes: 4 additions & 3 deletions docker-compose.yaml
    Original file line number Diff line number Diff line change
    @@ -3,9 +3,10 @@ version: "3"
    services:
    web:
    container_name: project_web
    build:
    context: ./
    dockerfile: Dockerfile
    image: docker pull ghcr.io/danielpetrica/php:7.4.10
    #build:
    # context: ./
    # dockerfile: Dockerfile
    volumes:
    - ./:/var/www/html
    ports:
  3. danielpetrica revised this gist May 14, 2022. 2 changed files with 5 additions and 2 deletions.
    3 changes: 3 additions & 0 deletions Readme.md
    Original file line number Diff line number Diff line change
    @@ -2,3 +2,6 @@ A docker compose example file to use with laravel projects for development on lo

    Before starting you should startup a docker network called local_docker from the cli.
    If you don't need to connect to external dockers you can remove the network configs altogheter.

    Feel free to change the services name.
    PLease set the .env file before starting docker.
    4 changes: 2 additions & 2 deletions docker-compose.yaml
    Original file line number Diff line number Diff line change
    @@ -2,7 +2,7 @@ version: "3"

    services:
    web:
    container_name: openapi_web
    container_name: project_web
    build:
    context: ./
    dockerfile: Dockerfile
    @@ -19,7 +19,7 @@ services:
    memory: 150M
    db:
    image: ghcr.io/danielpetrica/low-memory-mysql:master
    container_name: openapi_db
    container_name: project_db
    volumes:
    - dbdata:/var/lib/mysql/
    ports:
  4. danielpetrica revised this gist May 3, 2022. No changes.
  5. danielpetrica revised this gist May 3, 2022. No changes.
  6. danielpetrica created this gist May 3, 2022.
    4 changes: 4 additions & 0 deletions Readme.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,4 @@
    A docker compose example file to use with laravel projects for development on local machines (tested with wsl2).

    Before starting you should startup a docker network called local_docker from the cli.
    If you don't need to connect to external dockers you can remove the network configs altogheter.
    45 changes: 45 additions & 0 deletions docker-compose.yaml
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,45 @@
    version: "3"

    services:
    web:
    container_name: openapi_web
    build:
    context: ./
    dockerfile: Dockerfile
    volumes:
    - ./:/var/www/html
    ports:
    - 3005:80
    networks:
    - local_docker
    deploy:
    resources:
    limits:
    cpus: '0.1'
    memory: 150M
    db:
    image: ghcr.io/danielpetrica/low-memory-mysql:master
    container_name: openapi_db
    volumes:
    - dbdata:/var/lib/mysql/
    ports:
    - 6306:3306
    networks:
    - local_docker
    deploy:
    resources:
    limits:
    cpus: '0.5'
    memory: 100M
    environment:
    MYSQL_DATABASE: ${DB_DATABASE}
    MYSQL_USER: ${DB_USERNAME}
    MYSQL_PASSWORD: ${DB_PASSWORD}
    MYSQL_ROOT_PASSWORD: ${DB_PASSWORD}

    volumes:
    dbdata:

    networks:
    local_docker:
    external: true