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
# Install system dependencies
RUN apt-get update && apt-get install -y \
libpng-dev \
libjpeg-dev \
@ -14,25 +12,18 @@ RUN apt-get update && apt-get install -y \
libmagickwand-dev \
&& pecl install 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 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
# Copy the Laravel application files to the container
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
# Install/update application dependencies using Composer
RUN composer update && composer install
RUN npm ci
# Expose port 9000 to connect to the PHP-FPM server
EXPOSE 9000
# Start PHP-FPM to serve the Laravel application
CMD ["php-fpm"]

View File

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

View File

@ -11,6 +11,6 @@ server {
include fastcgi_params;
fastcgi_pass athenahr_app:9000;
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 language configuration
//! moment.js locale configuration