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

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

View File

@ -1,8 +1,8 @@
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\
git \
@ -12,7 +12,8 @@ RUN apt-get update && apt-get install -y\
libxml2-dev \
zip \
unzip \
libzip-dev \
libzip-dev\
nano \
openssl
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 ./
RUN composer install --no-dev --no-scripts --optimize-autoloader --no-interaction
RUN composer install --optimize-autoloader --no-interaction --no-scripts
COPY . .
COPY entrypoint.sh /usr/local/bin/entrypoint.sh
RUN chmod +x /usr/local/bin/entrypoint.sh
COPY entrypoint-dev.sh /usr/local/bin/entrypoint-dev.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
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
ENTRYPOINT ["/usr/local/bin/entrypoint-dev.sh"]
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
set -e
git config --global --add safe.directory /var/www/repuve-v1
echo "=== Iniciando entrypoint DESARROLLO ==="
# Variables desde Docker environment