-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #15 from iwasherefirst2/feature/change-title
Add dockerfiles to enhance package testing
- Loading branch information
Showing
6 changed files
with
138 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
FROM php:7.2-fpm | ||
|
||
# Arguments defined in docker-compose.yml | ||
ARG user | ||
ARG uid | ||
|
||
# Install system dependencies | ||
RUN apt-get update && apt-get install -y \ | ||
git \ | ||
curl \ | ||
libpng-dev \ | ||
libonig-dev \ | ||
libxml2-dev \ | ||
zip \ | ||
unzip \ | ||
libzip-dev \ | ||
-y mariadb-client | ||
|
||
# Clear cache | ||
RUN apt-get clean && rm -rf /var/lib/apt/lists/* | ||
|
||
# Install PHP extensions | ||
RUN docker-php-ext-install zip mysqli pdo_mysql mbstring exif pcntl bcmath gd && docker-php-ext-enable mysqli | ||
|
||
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer | ||
|
||
# Create system user to run Composer and Artisan Commands | ||
RUN useradd -G www-data,root -u $uid -d /home/$user $user | ||
RUN mkdir -p /home/$user/.composer && \ | ||
chown -R $user:$user /home/$user | ||
|
||
# Set working directory | ||
WORKDIR /var/www | ||
|
||
USER $user | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
version: "3.7" | ||
services: | ||
app: | ||
build: | ||
args: | ||
user: sammy | ||
uid: 1000 | ||
context: ./ | ||
dockerfile: Dockerfile.dev | ||
image: mailable | ||
container_name: mailable-app | ||
working_dir: /var/www/ | ||
environment: | ||
- COMPOSER_MEMORY_LIMIT=-1 | ||
depends_on: | ||
- db | ||
volumes: | ||
- ./:/var/www | ||
networks: | ||
- lahmi | ||
|
||
db: | ||
image: mysql:5.7 | ||
container_name: mailable-db | ||
environment: | ||
MYSQL_DATABASE: ${DB_DATABASE} | ||
MYSQL_ROOT_PASSWORD: ${DB_PASSWORD} | ||
MYSQL_PASSWORD: ${DB_PASSWORD} | ||
MYSQL_USER: ${DB_USERNAME} | ||
SERVICE_TAGS: dev | ||
SERVICE_NAME: mysql | ||
MYSQL_ROOT_PASSWORD: local | ||
volumes: | ||
- dbdata:/var/lib/mysql | ||
- ./docker-compose/mysql/my.cnf:/etc/mysql/my.cnf | ||
- ./docker-compose/mysql/init:/docker-entrypoint-initdb.d | ||
ports: | ||
- 3308:3306 | ||
networks: | ||
- lahmi | ||
|
||
nginx: | ||
image: nginx:alpine | ||
container_name: mailable-nginx | ||
ports: | ||
- 8006:80 | ||
depends_on: | ||
- db | ||
- app | ||
volumes: | ||
- ./:/var/www | ||
- ./docker-compose/nginx:/etc/nginx/conf.d/ | ||
networks: | ||
- lahmi | ||
|
||
networks: | ||
lahmi: | ||
driver: bridge | ||
|
||
volumes: | ||
dbdata: | ||
driver: local | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# create databases | ||
CREATE DATABASE IF NOT EXISTS `local_laravel`; | ||
|
||
# create local_developer user and grant rights | ||
CREATE USER 'local_developer'@'db' IDENTIFIED BY 'secret'; | ||
GRANT ALL PRIVILEGES ON *.* TO 'local_developer'@'%'; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
[mysqld] | ||
general_log = 1 | ||
general_log_file = /var/lib/mysql/general.log | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
server { | ||
listen 80; | ||
index index.php index.html; | ||
error_log /var/log/nginx/error.log; | ||
access_log /var/log/nginx/access.log; | ||
root /var/www/public; | ||
location ~ \.php$ { | ||
try_files $uri =404; | ||
fastcgi_split_path_info ^(.+\.php)(/.+)$; | ||
fastcgi_pass app:9000; | ||
fastcgi_index index.php; | ||
include fastcgi_params; | ||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | ||
fastcgi_param PATH_INFO $fastcgi_path_info; | ||
} | ||
location / { | ||
try_files $uri $uri/ /index.php?$query_string; | ||
gzip_static on; | ||
} | ||
} | ||
|