INIT: Commit Inicial

This commit is contained in:
Juan Felipe Zapata Moreno 2025-10-16 09:47:12 -06:00
parent 05d819687e
commit e8da447b68
6 changed files with 42 additions and 154 deletions

View File

@ -1,7 +1,7 @@
server { server {
listen 80; listen 80;
server_name _; server_name _;
root /var/www/holos.backend/public; root /var/www/golscontrols/public;
index index.php index.html; index index.php index.html;
# Logging # Logging
@ -17,7 +17,7 @@ server {
location ~ \.php$ { location ~ \.php$ {
try_files $uri =404; try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass holos-backend:9000; fastcgi_pass golscontrols:9000;
fastcgi_index index.php; fastcgi_index index.php;
# Timeouts importantes para evitar errores 500 # Timeouts importantes para evitar errores 500
@ -41,9 +41,21 @@ server {
fastcgi_param HTTP_PROXY ""; fastcgi_param HTTP_PROXY "";
} }
client_max_body_size 20M;
# Handle storage files (Laravel storage link) # Handle storage files (Laravel storage link)
location /storage { location /storage {
alias /var/www/holos.backend/storage/app/public; alias /var/www/golscontrols/storage/app;
try_files $uri =404;
}
location /profile {
alias /var/www/golscontrols/storage/app/profile;
try_files $uri =404;
}
location /images {
alias /var/www/golscontrols/storage/app/images;
try_files $uri =404; try_files $uri =404;
} }

View File

@ -1,87 +0,0 @@
services:
holos-backend:
build:
context: .
dockerfile: dockerfile.dev
working_dir: /var/www/holos.backend
environment:
- DB_HOST=mysql
- DB_USERNAME=${DB_USERNAME}
- DB_PASSWORD=${DB_PASSWORD}
- DB_DATABASE=${DB_DATABASE}
- DB_PORT=${DB_PORT}
volumes:
- ./:/var/www/holos.backend
- /var/www/holos.backend/vendor
networks:
- holos-network
depends_on:
mysql:
condition: service_healthy
redis:
condition: service_healthy
nginx:
image: nginx:alpine
ports:
- "${NGINX_PORT}:80"
volumes:
- ./public:/var/www/holos.backend/public
- ./Docker/nginx/nginx.conf:/etc/nginx/conf.d/default.conf
networks:
- holos-network
depends_on:
- holos-backend
mysql:
image: mysql:8.0
environment:
MYSQL_DATABASE: ${DB_DATABASE}
MYSQL_ROOT_PASSWORD: ${DB_PASSWORD}
MYSQL_PASSWORD: ${DB_PASSWORD}
MYSQL_USER: ${DB_USERNAME}
ports:
- ${DB_PORT}:${DB_PORT}
volumes:
- mysql_data:/var/lib/mysql
networks:
- holos-network
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost"]
timeout: 15s
retries: 10
phpmyadmin:
image: phpmyadmin/phpmyadmin
environment:
PMA_HOST: mysql
PMA_PORT: 3306
ports:
- '${PMA_PORT}:80'
depends_on:
- mysql
networks:
- holos-network
redis:
image: redis:alpine
ports:
- "${REDIS_PORT}:6379"
volumes:
- redis_data:/data
networks:
- holos-network
healthcheck:
test: ["CMD", "redis-cli", "ping"]
timeout: 5s
retries: 5
volumes:
mysql_data:
driver: local
redis_data:
driver: local
networks:
holos-network:
driver: bridge

View File

@ -1,9 +1,9 @@
services: services:
holos-backend: repuve-backend:
build: build:
context: . context: .
dockerfile: dockerfile dockerfile: dockerfile.dev
working_dir: /var/www/holos.backend working_dir: /var/www/repuve-v1
environment: environment:
- DB_HOST=mysql - DB_HOST=mysql
- DB_USERNAME=${DB_USERNAME} - DB_USERNAME=${DB_USERNAME}
@ -11,10 +11,10 @@ services:
- DB_DATABASE=${DB_DATABASE} - DB_DATABASE=${DB_DATABASE}
- DB_PORT=${DB_PORT} - DB_PORT=${DB_PORT}
volumes: volumes:
- app_storage:/var/www/holos.backend/storage - ./:/var/www/repuve-v1
- /var/www/repuve-v1/vendor
networks: networks:
- holos-network - repuve-network
restart: unless-stopped
depends_on: depends_on:
mysql: mysql:
condition: service_healthy condition: service_healthy
@ -26,13 +26,12 @@ services:
ports: ports:
- "${NGINX_PORT}:80" - "${NGINX_PORT}:80"
volumes: volumes:
- .:/var/www/holos.backend - ./public:/var/www/repuve-v1/public
- ./Docker/nginx/nginx.conf:/etc/nginx/conf.d/default.conf - ./Docker/nginx/nginx.conf:/etc/nginx/conf.d/default.conf
networks: networks:
- holos-network - repuve-network
restart: unless-stopped
depends_on: depends_on:
- holos-backend - repuve-backend
mysql: mysql:
image: mysql:8.0 image: mysql:8.0
@ -46,7 +45,7 @@ services:
volumes: volumes:
- mysql_data:/var/lib/mysql - mysql_data:/var/lib/mysql
networks: networks:
- holos-network - repuve-network
healthcheck: healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost"] test: ["CMD", "mysqladmin", "ping", "-h", "localhost"]
timeout: 15s timeout: 15s
@ -62,7 +61,7 @@ services:
depends_on: depends_on:
- mysql - mysql
networks: networks:
- holos-network - repuve-network
redis: redis:
image: redis:alpine image: redis:alpine
@ -71,7 +70,7 @@ services:
volumes: volumes:
- redis_data:/data - redis_data:/data
networks: networks:
- holos-network - repuve-network
healthcheck: healthcheck:
test: ["CMD", "redis-cli", "ping"] test: ["CMD", "redis-cli", "ping"]
timeout: 5s timeout: 5s
@ -82,9 +81,7 @@ volumes:
driver: local driver: local
redis_data: redis_data:
driver: local driver: local
app_storage:
driver: local
networks: networks:
holos-network: repuve-network:
driver: bridge driver: bridge

View File

@ -1,8 +1,8 @@
FROM php:8.3-fpm FROM php:8.3-fpm
RUN mkdir -p /var/www/holos.backend RUN mkdir -p /var/www/repuve-v1
WORKDIR /var/www/holos.backend WORKDIR /var/www/repuve-v1
RUN apt-get update && apt-get install -y\ RUN apt-get update && apt-get install -y\
git \ git \
@ -13,6 +13,7 @@ RUN apt-get update && apt-get install -y\
zip \ zip \
unzip \ unzip \
libzip-dev\ libzip-dev\
nano \
openssl openssl
RUN docker-php-ext-install pdo_mysql mbstring exif pcntl bcmath gd zip RUN docker-php-ext-install pdo_mysql mbstring exif pcntl bcmath gd zip
@ -21,16 +22,19 @@ COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
COPY composer.json composer.lock ./ COPY composer.json composer.lock ./
RUN composer install --no-dev --no-scripts --optimize-autoloader --no-interaction RUN composer install --optimize-autoloader --no-interaction --no-scripts
COPY . . COPY . .
COPY entrypoint.sh /usr/local/bin/entrypoint.sh COPY entrypoint-dev.sh /usr/local/bin/entrypoint-dev.sh
RUN chmod +x /usr/local/bin/entrypoint.sh RUN chmod +x /usr/local/bin/entrypoint-dev.sh
RUN chown -R www-data:www-data /var/www/holos.backend/storage /var/www/holos.backend/bootstrap/cache RUN mkdir -p storage/app/keys storage/logs bootstrap/cache
RUN chown -R www-data:www-data /var/www/repuve-v1/storage /var/www/repuve-v1/bootstrap/cache
RUN chmod -R 775 /var/www/repuve-v1/storage /var/www/repuve-v1/bootstrap/cache
EXPOSE 9000 EXPOSE 9000
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"] ENTRYPOINT ["/usr/local/bin/entrypoint-dev.sh"]
CMD ["php-fpm"] CMD ["php-fpm"]

View File

@ -1,40 +0,0 @@
FROM php:8.3-fpm
RUN mkdir -p /var/www/holos.backend
WORKDIR /var/www/holos.backend
RUN apt-get update && apt-get install -y\
git \
curl \
libpng-dev \
libonig-dev \
libxml2-dev \
zip \
unzip \
libzip-dev\
nano \
openssl
RUN docker-php-ext-install pdo_mysql mbstring exif pcntl bcmath gd zip
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
COPY composer.json composer.lock ./
RUN composer install --optimize-autoloader --no-interaction --no-scripts
COPY . .
COPY entrypoint-dev.sh /usr/local/bin/entrypoint-dev.sh
RUN chmod +x /usr/local/bin/entrypoint-dev.sh
RUN mkdir -p storage/app/keys storage/logs bootstrap/cache
RUN chown -R www-data:www-data /var/www/holos.backend/storage /var/www/holos.backend/bootstrap/cache
RUN chmod -R 775 /var/www/holos.backend/storage /var/www/holos.backend/bootstrap/cache
EXPOSE 9000
ENTRYPOINT ["/usr/local/bin/entrypoint-dev.sh"]
CMD ["php-fpm"]

View File

@ -1,6 +1,8 @@
#!/bin/bash #!/bin/bash
set -e set -e
git config --global --add safe.directory /var/www/repuve-v1
echo "=== Iniciando entrypoint DESARROLLO ===" echo "=== Iniciando entrypoint DESARROLLO ==="
# Variables desde Docker environment # Variables desde Docker environment