Skip to content

Commit dc58b13

Browse files
update docker
1 parent 208b811 commit dc58b13

File tree

88 files changed

+67
-203413
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

88 files changed

+67
-203413
lines changed

.env.test.example

Lines changed: 0 additions & 52 deletions
This file was deleted.

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,4 @@ yarn-error.log
1616
.vscode
1717
.DS_Store
1818
/docker/.env
19+
/docker/logs

.gitlab-ci_tmp.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ stages:
2424
unit_test:
2525
stage: test
2626
script:
27-
- cp .env.test.example .env
27+
- cp .env.example .env
2828
# - composer install --ignore-platform-reqs --no-dev --optimize-autoloader --no-ansi --no-interaction --no-progress
2929
# - php artisan key:generate
3030
# - php artisan migrate

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,11 @@ git clone https://github.com/maingocthanhtan96/LaraJS.git
6868
https://graphviz.org/download/ #(install graphviz)
6969
php artisan generate:erd public/images/diagram-erd.png
7070

71+
# Run docker
72+
cd docker
73+
cp .env.example .env
74+
docker-compose up -d
75+
7176
# Run bash script to install project (recommend)
7277
chmod u+x setup.sh && ./setup.sh
7378

app/Generators/Backend/ControllerGenerator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ private function generate($fields, $model): void
3535
$templateData = str_replace('{{LIMIT}}', $model['limit'], $templateData);
3636
$templateData = str_replace('{{COLUMN_SEARCH}}', '[' . $this->generateColumnSearch($fields) . ']', $templateData);
3737
$templateData = str_replace('{{COLUMN_RELATIONSHIP}}', '[]', $templateData);
38-
$templateData = str_replace('{{MODAL_CLASS_PARAM}}', \Str::camel($model['name']), $templateData);
38+
$templateData = str_replace('{{MODAL_CLASS_PARAM}}', \Str::camel(\Str::singular($model['name'])), $templateData);
3939

4040
$fileName = $model['name'] . 'Controller.php';
4141
$this->serviceFile->createFile($this->path, $fileName, $templateData);

app/Generators/Backend/SeederGenerator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public function generateFields($fields): string
6262
$fieldsGenerate[] = "'" . $field['field_name'] . "'" . ' => $faker->randomElement(' . json_encode($field['enum']) . '),';
6363
break;
6464
case $dbType['json']:
65-
$fieldsGenerate[] = "'" . $field['field_name'] . "'" . ' => "[{}],"';
65+
$fieldsGenerate[] = "'" . $field['field_name'] . "'" . ' => "[{}]",';
6666
break;
6767
case $dbType['file']:
6868
$fieldsGenerate[] = "'" . $field['field_name'] . "'" . ' => json_encode(["https://via.placeholder.com/350"]),';

docker-compose.yml

Lines changed: 0 additions & 72 deletions
This file was deleted.

docker/logs/nginx/app_access.log

Whitespace-only changes.

docker/logs/nginx/app_error.log

Whitespace-only changes.

docker/logs/nginx/error.log

Whitespace-only changes.

docker/logs/nginx/error.log.1

Lines changed: 0 additions & 81 deletions
This file was deleted.

docker/logs/nginx/laravel_access.log

Whitespace-only changes.

docker/logs/nginx/laravel_error.log

Whitespace-only changes.

docker/nginx/Dockerfile

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,10 @@ RUN touch /var/log/messages
2626
COPY logrotate/nginx /etc/logrotate.d/
2727

2828
# Set upstream conf and remove the default conf
29-
RUN echo "upstream php-upstream { server ${PHP_UPSTREAM_CONTAINER}:${PHP_UPSTREAM_PORT}; }" > /etc/nginx/conf.d/upstream.conf \
30-
&& rm /etc/nginx/conf.d/default.conf
31-
29+
RUN rm /etc/nginx/conf.d/default.conf
3230

3331
ADD ./startup.sh /opt/startup.sh
3432
RUN sed -i 's/\r//g' /opt/startup.sh
3533
CMD ["/bin/bash", "/opt/startup.sh"]
3634

37-
EXPOSE 80 443
35+
EXPOSE 80 81 443

docker/nginx/nginx.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
lluser www-data;
1+
user www-data;
22
worker_processes auto;
33
pid /run/nginx.pid;
44
daemon off;

docker/nginx/sites/default.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ server {
1919

2020
location ~ \.php$ {
2121
try_files $uri /index.php =404;
22-
fastcgi_pass php-upstream;
22+
fastcgi_pass app:9000;
2323
fastcgi_index index.php;
2424
fastcgi_buffers 16 16k;
2525
fastcgi_buffer_size 32k;

docker/php-fpm/Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM php:7.4-fpm-alpine
1+
FROM php:7.4-fpm
22

33
LABEL maintainer="[email protected]"
44

@@ -37,9 +37,9 @@ COPY ../../ /var/www
3737

3838
# Add crontab
3939
USER root
40-
COPY ./php-fpm/app-entrypoint.sh /
40+
COPY ./app-entrypoint.sh /
4141
# Add crontab file in the cron directory
42-
COPY ./php-fpm/crontab /etc/cron.d
42+
COPY ./crontab /etc/cron.d
4343
# Give execution rights on the cron job
4444
RUN chmod -R 644 /etc/cron.d
4545

0 commit comments

Comments
 (0)