feat(docker): update docker, nginx config

Signed-off-by: miguel456 <me@nogueira.codes>
This commit is contained in:
Miguel Nogueira 2023-08-07 21:56:09 +01:00
parent 9dc82708dd
commit c48db3f435
No known key found for this signature in database
GPG Key ID: 3C6A7E29AF26D370
5 changed files with 30 additions and 34 deletions

10
.dockerignore Normal file
View File

@ -0,0 +1,10 @@
# app is configured through docker-compose
.env
# deps are installed during build time
node_modules
vendor
# Let the framework create these. we don't need your cache if you rebuild the image
storage/debugbar
storage/logs
storage/framework
storage/env-editor

View File

@ -1,7 +1,5 @@
# Use the official PHP-FPM image as the base image
FROM php:8.1-fpm FROM php:8.1-fpm
# Install system dependencies
RUN apt-get update && apt-get install -y \ RUN apt-get update && apt-get install -y \
libpng-dev \ libpng-dev \
libjpeg-dev \ libjpeg-dev \
@ -14,25 +12,18 @@ RUN apt-get update && apt-get install -y \
libmagickwand-dev \ libmagickwand-dev \
&& pecl install imagick \ && pecl install imagick \
&& docker-php-ext-enable imagick && docker-php-ext-enable imagick
# Remove xdebug later
# Install PHP extensions
RUN docker-php-ext-install gd pdo pdo_mysql zip curl mbstring xml RUN docker-php-ext-install gd pdo pdo_mysql zip curl mbstring xml
RUN curl -fsSL https://deb.nodesource.com/setup_18.x | bash -
RUN apt-get install -y nodejs
# Set the working directory in the container
WORKDIR /var/www/html WORKDIR /var/www/html
# Copy the Laravel application files to the container
COPY . . COPY . .
# Install Composer (if you haven't installed it globally on your host machine)
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
# Install/update application dependencies using Composer
RUN composer update && composer install RUN composer update && composer install
RUN npm ci
# Expose port 9000 to connect to the PHP-FPM server
EXPOSE 9000 EXPOSE 9000
# Start PHP-FPM to serve the Laravel application
CMD ["php-fpm"] CMD ["php-fpm"]

View File

@ -2,36 +2,33 @@ version: '3.8'
services: services:
athenahr_app: athenahr_app:
image: athenahr image: gitlab.futuregamers.co:5050/webvokestudio/athenahr:latest
container_name: athenahr_app container_name: athenahr_app
volumes: volumes:
- ./rbrecruiter-gc:/var/www/html - ./:/var/www/html
ports: ports:
- "8080:9000" - ":9000"
networks: networks:
- athenahrdev_network - athenahrdev_network
depends_on: depends_on:
- athenahrdev_node
- mariadb - mariadb
environment:
athenahrdev_node: - DB_HOST=mariadb
image: node:14 - DB_DATABASE=athenahr
container_name: athenahr_node - DB_USERNAME=athenahr
volumes: - DB_PASSWORD=athenahr_db_pw
- ./rbrecruiter-gc:/usr/src/app env_file:
working_dir: /usr/src/app - .env
networks:
- athenahrdev_network
mariadb: mariadb:
image: mariadb:latest image: mariadb:latest
container_name: athenahr_mariadb container_name: athenahr_mariadb
command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW
environment: environment:
- MYSQL_DATABASE=my_database - MYSQL_DATABASE=athenahr
- MYSQL_USER=my_user - MYSQL_USER=athenahr
- MYSQL_PASSWORD=my_password - MYSQL_PASSWORD=athenahr_db_pw
- MYSQL_ROOT_PASSWORD=my_root_password - MYSQL_ROOT_PASSWORD=athenahr_db_pw
volumes: volumes:
- mariadb_data:/var/lib/mysql - mariadb_data:/var/lib/mysql
networks: networks:
@ -41,7 +38,7 @@ services:
image: nginx:latest image: nginx:latest
container_name: athenahr_nginx container_name: athenahr_nginx
volumes: volumes:
- ./rbrecruiter-gc:/var/www/html - ./:/var/www/html
- ./docker/nginx:/etc/nginx/conf.d - ./docker/nginx:/etc/nginx/conf.d
ports: ports:
- "8989:80" - "8989:80"

View File

@ -11,6 +11,6 @@ server {
include fastcgi_params; include fastcgi_params;
fastcgi_pass athenahr_app:9000; fastcgi_pass athenahr_app:9000;
fastcgi_index index.php; fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /var/www/html$fastcgi_script_name; fastcgi_param SCRIPT_FILENAME /var/www/html/public$fastcgi_script_name;
} }
} }

View File

@ -89,6 +89,4 @@
//! moment.js //! moment.js
//! moment.js language configuration
//! moment.js locale configuration //! moment.js locale configuration