Skip to content

Commit

Permalink
chore: change docker to work with franken
Browse files Browse the repository at this point in the history
  • Loading branch information
jesusantguerrero committed Dec 21, 2023
1 parent 6e1df86 commit 8971201
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 80 deletions.
9 changes: 1 addition & 8 deletions Caddyfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,10 @@
}

# The domain name of your server
loger.localhost {
# Set the webroot to the public/ dir
dev-loger.neatlancer.com {
root * public/
# Enable compression (optional)
encode zstd gzip
# Execute PHP files in the current directory and serve assets
php_server {
# Required for the public/storage/ dir
resolve_root_symlink
}

Expand All @@ -21,7 +17,4 @@ loger.localhost {
# Subscriber JWT key
subscriber_jwt !ChangeThisMercureHubJWTSecretKey!
}

respond "Not Found" 404

}
17 changes: 17 additions & 0 deletions Caddyfile.dev
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
frankenphp
order php_server before file_server
}

# The domain name of your server
localhost {
# Set the webroot to the public/ dir
root * public/
# Enable compression (optional)
encode zstd gzip
# Execute PHP files in the current directory and serve assets
php_server {
# Required for the public/storage/ dir
resolve_root_symlink
}
}
14 changes: 2 additions & 12 deletions docker-compose.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ services:
restart: unless-stopped
volumes:
- ./:/app
- ./Caddyfile.dev:/etc/caddy/Caddyfile
- ./docker-compose/web/timezone:/etc/timezone
- loger_db:/var/lib/mysql
networks:
Expand Down Expand Up @@ -42,17 +43,6 @@ services:
- ./docker-compose/mysql:/home/root/cache/
networks:
- loger
# nginx:
# image: nginx:alpine
# container_name: loger-nginx
# restart: unless-stopped
# ports:
# - "8080:80"
# volumes:
# - ./:/var/www
# - ./docker-compose/nginx/vhosts:/etc/nginx/conf.d/
# networks:
# - loger
redis:
image: 'redis:alpine'
ports:
Expand Down Expand Up @@ -80,7 +70,7 @@ services:
dockerfile: cron.dockerfile
container_name: cron
volumes:
- ./:/var/www
- ./:/app
depends_on:
- web
networks:
Expand Down
66 changes: 6 additions & 60 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,55 +1,8 @@
version: "3.7"
services:
web-proxy:
image: nginxproxy/nginx-proxy:latest
container_name: web-proxy
restart: unless-stopped
ports:
- 80:80
- 443:443
volumes:
- ./:/var/www
- ./docker-compose/nginx:/etc/nginx/conf.d/
- ./docker-compose/nginx:/etc/nginx/certs:ro
- /var/run/docker.sock:/tmp/docker.sock:ro
- ./docker-compose/nginx/vhosts:/etc/nginx/vhost.d
- ./:/usr/share/nginx/html
networks:
- loger
depends_on:
- nginx
ssl-companion:
image: jrcs/letsencrypt-nginx-proxy-companion
container_name: ssl-companion
restart: always
volumes_from:
- web-proxy
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- ./docker-compose/nginx:/etc/nginx/certs:rw
depends_on:
- web-proxy
nginx:
image: nginx:alpine
container_name: web-nginx
restart: unless-stopped
ports:
- 8080:80
volumes:
- ./:/var/www
- ./docker-compose/nginx/vhosts:/etc/nginx/conf.d/
- ./:/usr/share/nginx/html
environment:
- VIRTUAL_PORT=80
- VIRTUAL_HOST=${VIRTUAL_APP_HOST}
- LETSENCRYPT_HOST=${VIRTUAL_APP_HOST}
- [email protected]
networks:
- loger
web:
build:
args:
user: 'loger'
uid: 1000
TZ: America\New_York
context: ./
Expand All @@ -60,7 +13,8 @@ services:
depends_on:
- db
volumes:
- ./:/var/www
- ./:/app
- ./Caddyfile:/etc/caddy/Caddyfile
- loger_db:/var/lib/mysql
networks:
- loger
Expand All @@ -73,19 +27,14 @@ services:
restart: unless-stopped
ports:
- 3000:3000
environment:
- VIRTUAL_PORT=3000
- VIRTUAL_HOST=${VIRTUAL_LANDING_HOST}
- LETSENCRYPT_HOST=${VIRTUAL_LANDING_HOST}
- [email protected]
networks:
- loger
db:
image: mysql:5.7
image: mariadb:10.8.4
container_name: loger-db
restart: always
ports:
- "3308:3306"
- "3306:3306"
environment:
MYSQL_DATABASE: ${DB_DATABASE}
MYSQL_ROOT_PASSWORD: ${DB_PASSWORD}
Expand Down Expand Up @@ -114,8 +63,8 @@ services:
dockerfile: cron.dockerfile
container_name: cron
volumes:
- ./:/var/www
working_dir: /var/www
- ./:/app
working_dir: /app
depends_on:
- web
networks:
Expand All @@ -131,9 +80,6 @@ services:
env_file: .env
environment:
- MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
- VIRTUAL_HOST=phpmyadmin.${HOST_DOMAIN}
- LETSENCRYPT_HOST=phpmyadmin.${HOST_DOMAIN}
- [email protected]
networks:
loger:
driver: bridge
Expand Down

0 comments on commit 8971201

Please sign in to comment.