Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
calendrier
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Caillou pète des roches
calendrier
Commits
959dbc8a
Verified
Commit
959dbc8a
authored
3 years ago
by
Romain Lebbadi-Breteau
Browse files
Options
Downloads
Patches
Plain Diff
Add gitlab cicd
parent
e4fa276c
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#5346
failed
2 years ago
Stage: lint
Stage: test
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
.gitlab-ci.yml
+39
-0
39 additions, 0 deletions
.gitlab-ci.yml
docker/Dockerfile.prod
+28
-0
28 additions, 0 deletions
docker/Dockerfile.prod
with
67 additions
and
0 deletions
.gitlab-ci.yml
0 → 100644
+
39
−
0
View file @
959dbc8a
variables
:
DOCKER_HOST
:
tcp://dockerhost:2375/
DOCKER_DRIVER
:
overlay2
DOCKER_TLS_CERTDIR
:
'
'
stages
:
-
lint
-
test
-
build
lint
:
stage
:
lint
image
:
php:8.1-cli
before_script
:
-
apt-get update -y && apt-get install -y git zip unzip libzip-dev
-
docker-php-ext-install zip
-
curl -sS https://getcomposer.org/installer | php
-
php composer.phar install
script
:
-
php bin/console lint:yaml config
-
php bin/console lint:container
-
php vendor/bin/phplint --exclude=vendor --exclude=var --no-cache -v
include
:
-
template
:
Security/SAST.gitlab-ci.yml
build_image
:
image
:
docker
services
:
-
name
:
docker:dind
alias
:
dockerhost
stage
:
build
before_script
:
-
docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
script
:
-
docker build -t $CI_REGISTRY_IMAGE:$CI_COMMIT_BRANCH -f docker/Dockerfile.prod .
-
docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_BRANCH
only
:
-
main
This diff is collapsed.
Click to expand it.
docker/Dockerfile.prod
0 → 100644
+
28
−
0
View file @
959dbc8a
FROM php:8.1-fpm-alpine
COPY docker/wait-for-it.sh /usr/local/bin/wait-for-it
RUN chmod +x /usr/local/bin/wait-for-it && apk add --no-cache bash
ENV APP_ENV=prod
WORKDIR /var/www/html
ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/
RUN chmod +x /usr/local/bin/install-php-extensions && sync && install-php-extensions \
apcu \
intl \
opcache \
openssl \
pdo_pgsql \
zip
RUN mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini"
COPY --from=composer /usr/bin/composer /usr/bin/composer
RUN apk add --no-cache nginx
COPY docker/nginx.conf docker/calendar.conf /etc/nginx/
COPY --chown=root:root . .
RUN composer install --prefer-dist --no-dev --optimize-autoloader
CMD php bin/console cache:clear && wait-for-it database:5432 -- bin/console doctrine:migrations:migrate -n && nginx && php-fpm
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