Skip to content

Commit

Permalink
Update docker compose names
Browse files Browse the repository at this point in the history
  • Loading branch information
relliv committed Jun 27, 2024
1 parent 80e308c commit ea15a2b
Show file tree
Hide file tree
Showing 2 changed files with 112 additions and 104 deletions.
118 changes: 61 additions & 57 deletions docker-compose-dev.yml
Original file line number Diff line number Diff line change
@@ -1,62 +1,66 @@
version: "3.8"
# Example Dev Environment Setup

version: '3.8'

name: ls_dev

services:
# Laravel App X
laravel_app_x:
build:
context: ./src
container_name: laravel_app_x
restart: unless-stopped
ports:
- ${LARAVEL_APP_X_PORT}:8000
volumes:
- ./src:/var/www/html
environment:
RUN_LARAVEL_AUTOMATIONS: "true"
command: php -S laravel_app_x:8000 -t ./public
networks:
- mysql_net
- redis_net

# MySQL
laravel_mysql_db:
image: mysql:latest
container_name: laravel_mysql_db
restart: unless-stopped
ports:
- ${MYSQL_PORT}:3306
environment:
MYSQL_DATABASE: ${MYSQL_DB}
ON_CREATE_DB: ${MYSQL_DB}
MYSQL_USER: ${MYSQL_USER}
MYSQL_PASSWORD: ${MYSQL_PASSWORD}
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
networks:
- mysql_net

# Redis
laravel_redis:
image: redis:alpine
container_name: laravel_redis
hostname: laravel_app_x
restart: always
ports:
- ${LARAVEL_REDIS_POST}:6379
networks:
- redis_net

# MailHog Server
laravel_mail_hog:
image: mailhog/mailhog:latest
container_name: laravel_mail_hog
restart: unless-stopped
ports:
- 10001:1025
- 10002:8025
# Laravel App X
laravel_app_x:
build:
context: ./src
container_name: laravel_app_x
restart: unless-stopped
ports:
- ${LARAVEL_APP_X_PORT}:8000
volumes:
- ./src:/var/www/html
environment:
RUN_LARAVEL_AUTOMATIONS: 'true'
command: php -S laravel_app_x:8000 -t ./public
networks:
- mysql_net
- redis_net

# MySQL
laravel_mysql_db:
image: mysql:latest
container_name: laravel_mysql_db
restart: unless-stopped
ports:
- ${MYSQL_PORT}:3306
environment:
MYSQL_DATABASE: ${MYSQL_DB}
ON_CREATE_DB: ${MYSQL_DB}
MYSQL_USER: ${MYSQL_USER}
MYSQL_PASSWORD: ${MYSQL_PASSWORD}
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
networks:
- mysql_net

# Redis
laravel_redis:
image: redis:alpine
container_name: laravel_redis
hostname: laravel_app_x
restart: always
ports:
- ${LARAVEL_REDIS_POST}:6379
networks:
- redis_net

# MailHog Server
laravel_mail_hog:
image: mailhog/mailhog:latest
container_name: laravel_mail_hog
restart: unless-stopped
ports:
- 10001:1025
- 10002:8025

networks:
mysql_net:
driver: bridge
mysql_net:
driver: bridge

redis_net:
driver: bridge
redis_net:
driver: bridge
98 changes: 51 additions & 47 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,54 +1,58 @@
version: "3.8"
# Example Prod Environment Setup

version: '3.8'

name: ls_prod

services:
# Laravel Starter App
laravel_starter_app:
image: serversideup/php:8.2-fpm-nginx
container_name: laravel_starter_app
stdin_open: true
tty: true
ports:
- ${WEB_APP_PORT}:80
volumes:
- ./:/var/www/html
environment:
RUN_LARAVEL_AUTOMATIONS: "false"
AUTORUN_ENABLED: "true"
AUTORUN_LARAVEL_STORAGE_LINK: "false"
networks:
- mysql_net
- redis_net
# Laravel Starter App
laravel_starter_app:
image: serversideup/php:8.2-fpm-nginx
container_name: laravel_starter_app
stdin_open: true
tty: true
ports:
- ${WEB_APP_PORT}:80
volumes:
- ./:/var/www/html
environment:
RUN_LARAVEL_AUTOMATIONS: 'false'
AUTORUN_ENABLED: 'true'
AUTORUN_LARAVEL_STORAGE_LINK: 'false'
networks:
- mysql_net
- redis_net

# MySQL
laravel_mysql_db:
image: mysql:latest
container_name: laravel_mysql_db
restart: unless-stopped
ports:
- ${MYSQL_PORT}:3306
environment:
MYSQL_DATABASE: ${MYSQL_DB}
ON_CREATE_DB: ${MYSQL_DB}
MYSQL_USER: ${MYSQL_USER}
MYSQL_PASSWORD: ${MYSQL_PASSWORD}
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
networks:
- mysql_net
# MySQL
laravel_mysql_db:
image: mysql:latest
container_name: laravel_mysql_db
restart: unless-stopped
ports:
- ${MYSQL_PORT}:3306
environment:
MYSQL_DATABASE: ${MYSQL_DB}
ON_CREATE_DB: ${MYSQL_DB}
MYSQL_USER: ${MYSQL_USER}
MYSQL_PASSWORD: ${MYSQL_PASSWORD}
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
networks:
- mysql_net

# Redis
laravel_redis:
image: redis:alpine
container_name: laravel_redis
hostname: laravel_starter_app
restart: always
ports:
- ${LARAVEL_REDIS_POST}:6379
networks:
- redis_net
# Redis
laravel_redis:
image: redis:alpine
container_name: laravel_redis
hostname: laravel_starter_app
restart: always
ports:
- ${LARAVEL_REDIS_POST}:6379
networks:
- redis_net

networks:
mysql_net:
driver: bridge
mysql_net:
driver: bridge

redis_net:
driver: bridge
redis_net:
driver: bridge

0 comments on commit ea15a2b

Please sign in to comment.