Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
monitoring
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
cylab
monitoring
Commits
243c4c29
Commit
243c4c29
authored
1 year ago
by
Thibault Debatty
Browse files
Options
Downloads
Patches
Plain Diff
build docker image
parent
19856341
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#11626
passed
1 year ago
Stage: test
Changes
4
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
.gitlab-ci.yml
+18
-0
18 additions, 0 deletions
.gitlab-ci.yml
Dockerfile
+42
-0
42 additions, 0 deletions
Dockerfile
docker/env.default
+36
-0
36 additions, 0 deletions
docker/env.default
docker/logs.conf
+5
-0
5 additions, 0 deletions
docker/logs.conf
with
101 additions
and
0 deletions
.gitlab-ci.yml
+
18
−
0
View file @
243c4c29
...
...
@@ -43,3 +43,21 @@ test:gitleaks:
-
git config --global --add safe.directory $CI_PROJECT_DIR
-
gitleaks detect -v -c gitleaks.toml ./
build
:
stage
:
test
## Run on a gitlab-runner that is configured with docker-in-docker
tags
:
-
dind
image
:
docker:20.10.16
services
:
-
docker:20.10.16-dind
variables
:
DOCKER_TLS_CERTDIR
:
"
/certs"
before_script
:
-
docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
script
:
-
docker pull $CI_REGISTRY_IMAGE:latest ||
true
-
docker build --cache-from $CI_REGISTRY_IMAGE:latest --tag $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA --tag $CI_REGISTRY_IMAGE:latest .
-
docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA
-
docker push $CI_REGISTRY_IMAGE:latest
This diff is collapsed.
Click to expand it.
Dockerfile
0 → 100644
+
42
−
0
View file @
243c4c29
#
# monitoring
# Dockerfile used to build the production container
#
#### Step 1 : composer
FROM
cylab/php74
AS
composer
COPY
. /var/www/html
WORKDIR
/var/www/html
RUN
composer
install
--no-dev
--optimize-autoloader
#### Step 2 : node
FROM
node:16.15.0-alpine
AS
node
COPY
. /var/www/html
WORKDIR
/var/www/html
RUN
npm
--version
&&
npm
install
&&
npm run prod
#### Step 3 : the actual docker image
FROM
cylab/laravel74
# Custom logs : request time, laravel session
COPY
./docker/logs.conf /etc/apache2/conf-available/logs.conf
RUN
a2enconf logs
# Increase upload limit
RUN
sed
-i
's/upload_max_filesize = 2M/upload_max_filesize = 20M/g'
/usr/local/etc/php/php.ini
&&
\
sed
-i
's/post_max_size = 8M/post_max_size = 20M/g'
/usr/local/etc/php/php.ini
COPY
. /var/www/html
COPY
./docker/env.default /var/www/html/.env
COPY
--from=composer /var/www/html/vendor /var/www/html/vendor
COPY
--from=node /var/www/html/public/css /var/www/html/public/css
COPY
--from=node /var/www/html/public/js /var/www/html/public/js
COPY
--from=node /var/www/html/public/fonts /var/www/html/public/fonts
This diff is collapsed.
Click to expand it.
docker/env.default
0 → 100644
+
36
−
0
View file @
243c4c29
#
# monitor/docker/env.default
# provide some default values for the monitor docker container
#
APP_NAME=Monitor
APP_ENV=prod
APP_KEY=base64:oeFm60LGCyfXgd2MmUs/OVX3n4tJb6DG/BG2SS4DFdo=
APP_DEBUG=false
APP_URL=https://monitor.web-d.be
LOG_CHANNEL=stack
DB_CONNECTION=mysql
DB_HOST=mysql
DB_PORT=3306
DB_DATABASE=laravel
DB_USERNAME=root
DB_PASSWORD=root
MAIL_DRIVER=smtp
MAIL_HOST=mail
MAIL_PORT=
MAIL_USERNAME=
MAIL_PASSWORD=
MAIL_ENCRYPTION=tls
BROADCAST_DRIVER=log
CACHE_DRIVER=redis
QUEUE_driver=redis
SESSION_DRIVER=redis
REDIS_HOST=redis
REDIS_PASSWORD=null
REDIS_PORT=6379
This diff is collapsed.
Click to expand it.
docker/logs.conf
0 → 100644
+
5
−
0
View file @
243c4c29
#
# https://cylab.be/blog/244/custom-apache-logs
#
LogFormat
"%h %l %u %t \"
%
r
\
" %>s %O \"
%{
Referer
}
i
\
" \"
%{
User
-
Agent
}
i
\
" %D %{laravel_session}C"
combined
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment