Refactor Docker setup to clean up dependencies and configs

Removed unnecessary packages, environment variables, and Sail-specific configurations. Replaced "sail" with "nntmux" for images, networks, and volumes. Simplified the setup by removing unused tests and redundant configurations.
This commit is contained in:
PyRowMan
2024-12-18 10:57:10 +01:00
parent 0cc01331f2
commit 5a7ab28513
2 changed files with 26 additions and 66 deletions
+3 -4
View File
@@ -17,7 +17,7 @@ RUN apt update \
&& apt install -y --no-install-recommends \
unrar-free 7zip lame libcap2-bin python3 \
curl zip unzip git nano bash-completion sudo wget tmux time fonts-powerline \
gnupg sqlite3 libpng-dev dnsutils jq htop iputils-ping net-tools ffmpeg \
gnupg libpng-dev dnsutils jq htop iputils-ping net-tools ffmpeg \
jpegoptim webp optipng pngquant libavif-bin watch iproute2 nmon \
libonig-dev libxml2-dev libicu-dev libjpeg-dev libfreetype6-dev libxslt-dev $MYSQL_CLIENT libcurl4-openssl-dev \
&& wget https://mediaarea.net/repo/deb/repo-mediaarea_1.0-24_all.deb \
@@ -51,13 +51,12 @@ RUN ARCH="$(dpkg --print-architecture)" && \
RUN mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini"
RUN npm install -g bun pnpm
COPY --chmod=755 ./docker-entrypoint.sh /usr/local/bin/docker-entrypoint
RUN chmod +x /usr/local/bin/docker-entrypoint
COPY . /app
RUN rm -Rf tests/
RUN composer install
RUN chmod -R 755 /app/vendor/
+17 -56
View File
@@ -3,17 +3,13 @@ services:
build:
context: .
dockerfile: Dockerfile
image: sail-8.3/app
image: nntmux
extra_hosts:
- 'host.docker.internal:host-gateway'
ports:
- '${APP_PORT:-80}:80'
environment:
TZ: ${APP_TIMEZONE}
COMPOSER_AUTH: ${COMPOSER_AUTH}
XDEBUG_MODE: '${SAIL_XDEBUG_MODE:-off}'
XDEBUG_CONFIG: '${SAIL_XDEBUG_CONFIG:-client_host=host.docker.internal}'
IGNITION_LOCAL_SITES_PATH: '${PWD}'
healthcheck:
test: [ "CMD", "curl", "-f", "http://localhost:80" ]
interval: 10s
@@ -26,7 +22,7 @@ services:
- 'storage:/app/storage'
# - 'resources:/var/www/html/resources'
networks:
- sail
- nntmux
depends_on:
- mariadb
- redis
@@ -35,28 +31,24 @@ services:
worker:
command: >
sh -c "php artisan tmux-ui:start & php artisan horizon"
image: sail-8.3/app
image: nntmux
extra_hosts:
- 'host.docker.internal:host-gateway'
tty: true
environment:
TZ: ${APP_TIMEZONE}
COMPOSER_AUTH: ${COMPOSER_AUTH}
XDEBUG_MODE: '${SAIL_XDEBUG_MODE:-off}'
XDEBUG_CONFIG: '${SAIL_XDEBUG_CONFIG:-client_host=host.docker.internal}'
IGNITION_LOCAL_SITES_PATH: '${PWD}'
env_file:
- .env
volumes:
- 'install:/app/_install'
- 'storage:/app/storage'
networks:
- sail
- nntmux
depends_on:
webapp:
condition: service_healthy
scheduler:
image: sail-8.3/app
image: nntmux
extra_hosts:
- 'host.docker.internal:host-gateway'
tty: true
@@ -64,15 +56,11 @@ services:
- .env
environment:
TZ: ${APP_TIMEZONE}
COMPOSER_AUTH: ${COMPOSER_AUTH}
XDEBUG_MODE: '${SAIL_XDEBUG_MODE:-off}'
XDEBUG_CONFIG: '${SAIL_XDEBUG_CONFIG:-client_host=host.docker.internal}'
IGNITION_LOCAL_SITES_PATH: '${PWD}'
volumes:
- 'install:/app/_install'
- 'storage:/app/storage'
networks:
- sail
- nntmux
depends_on:
webapp:
condition: service_healthy
@@ -95,10 +83,10 @@ services:
--group_concat_max_len=16384
--max_connections=200
volumes:
- 'sail-mariadb:/var/lib/mysql'
- 'mariadb:/var/lib/mysql'
- './vendor/laravel/sail/database/mariadb/create-testing-database.sh:/docker-entrypoint-initdb.d/10-create-testing-database.sh'
networks:
- sail
- nntmux
healthcheck:
test:
- CMD
@@ -114,9 +102,9 @@ services:
environment:
TZ: ${APP_TIMEZONE}
volumes:
- 'sail-redis:/data'
- 'redis:/data'
networks:
- sail
- nntmux
healthcheck:
test:
- CMD
@@ -130,29 +118,7 @@ services:
- '${FORWARD_MAILPIT_PORT:-1025}:1025'
- '${FORWARD_MAILPIT_DASHBOARD_PORT:-8025}:8025'
networks:
- sail
# manticore:
# image: manticoresearch/manticore
# environment:
# TZ: ${APP_TIMEZONE}
# EXTRA: 1 # Activates extra features
# restart: always
# ports:
# - 9306:9306
# - 9308:9308
# ulimits:
# nproc: 65535
# nofile:
# soft: 65535
# hard: 65535
# memlock:
# soft: -1
# hard: -1
# volumes:
# - 'sail-manticore:/var/lib/manticore'
# - ./misc/manticoresearch/manticore.conf:/etc/manticoresearch/manticore.conf # uncomment if you use a custom config
# networks:
# - sail
- nntmux
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:8.17.0
environment:
@@ -164,25 +130,20 @@ services:
- 9200:9200
- 9300:9300
volumes:
- sail-elasticsearch:/usr/share/elasticsearch/data
- elasticsearch
networks:
- sail
- nntmux
deploy:
resources:
limits:
memory: 1g
networks:
sail:
nntmux:
driver: bridge
volumes:
sail-mariadb:
driver: local
sail-redis:
driver: local
sail-manticore:
driver: local
sail-elasticsearch:
driver: local
mariadb:
redis:
elasticsearch:
storage:
resources:
install: