Giter Site home page Giter Site logo

filament-ci's Introduction

Laravel Gitlab-CI

GitHub Docker Image Size (tag) Docker Pulls Docker Image Version (latest semver) Docker Cloud Automated build Docker Cloud Build Status

About

A Dockerfile for building an image for your Laravel app Gitlab CI/CD pipelines.

Table of Contents

Folder Structure

Although folder structure is self-explanatory, description is as below:

.
├── Dockerfile
├── LICENSE
├── readme.md
├── scripts
│   ├── cleanup.sh            # Removes build dependencies for lighter image size.
│   ├── install-node-yarn.sh  # Install your global npm/yarn packages here.
│   ├── install-packages.sh   # OS packages will be installed by this file.
│   └── install-php.sh        # PHP extensions and installation.
└── tests
    └── goss.yaml             # See "testing" section

Packages and Services

We created the Dockerfile with image size in mind, only packages and PHP extensions which are absolutely necessary are installed.

Service Version Argument
PHP 8.2.0 PHP_VERSION
Composer 2.2.5 COMPOSER_VERSION
Node 19.4.0 NODE_VERSION
NPM 9.2.0 NPM_VERSION
Yarn latest N/A
reg latest N/A
cfcli latest N/A
local-php-security-checker latest N/A

Customizing build versions

As you can see in the table above, some services have an argument in Dockerfile for you to modify the installation version. To do so, you need to clone the repo and build the image yourself:

git clone https://github.com/laramatics/gitlab-ci.git
cd gitlab-ci
# Modify files...
docker build \
  --build-arg NPM_VERSION=9.2.0 \
  --build-arg PHP_VERSION=8.2.0 \
  -t <image_name> .

Adding more PHP extensions

If you want to add more extensions to the PHP installation, you will have to build your own image based on the one already built or modify the Dockerfile and scripts/* to your liking and build your own image from it.

See Docker PHP Extension Installer for available extensions, alternatively you can install them fom source.

FROM laramatics/gitlab-ci:latest
# Add your extentions here...
RUN docker-php-ext-install -j "$(nproc)" <package_name>

Adding more packages

Sometimes you need a specific package for your pipeline; as described in the previous section, you can build your own image from laramatics/gitlab-ci or clone this repo and modify files to suit your needs.

git clone https://github.com/laramatics/gitlab-ci.git
cd gitlab-ci
# Modify files...
docker build -t <image_name> .

Testing

Tests are written using GOSS, to test your changes after modifying source files and building your own image, run:

GOSS_FILES_PATH=tests dgoss run -it <image_name>

References

filament-ci's People

Contributors

pezhvak avatar ardavan-ansari avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.