Closed kemboi22 closed 1 month ago
Introduction of Dockerization New Docker-related files have been added to the project. Docker is a technology that helps us streamline and simplify how we use software, ensuring that our project runs the same way no matter where we use it.
Addition of .dockerignore file
Added a .dockerignore
file which tells Docker to skip certain files or folders when creating the Docker image. This includes the project.zip
, TODO
, and testsuite
files which are not needed in the live environment.
Creation of Dockerfile
A Dockerfile
has been created which outlines how our Docker image should be built, which includes using PHP version 8.2, installing various dependencies like Git, CURL, Nodejs, and others needed for our application to work, copying our application files to the image, and setting up the environment for our application to run, including a Supervisor for Laravel queues.
Development of docker-compose.yml file
The docker-compose.yml
file sets up all the services our application needs to run. These services include the application itself, a web server, a database, and a queue.
Establishment of Docker crontab file
The docker/crontab
executes regular tasks in the Docker environment. For our case, it is set to run a certain command related to the Laravel schedule every minute.
Docker Entrypoint Setup
The docker/entrypoint.sh
file is the first script that runs when our Docker image starts. It sets up the application by checking and setting up the environment file, handling permissions, caching and optimizing the application, waiting for the database to be ready, running any necessary database migrations, and initiating the command to start our application.
Configuration of Supervisor
Added a docker/supervisord.conf
which manages Laravel Queues that perform background jobs for the application.
Addition of NGINX Configuration file
An nginx/nginx.conf
configuration file has been added to define server configurations for our application within the Docker environment. NGINX is a powerful software that can act as a web server for our application.
When pushing to Docker hub Add the following github workflow
name: Build and Push Multi-Platform Docker Image
on:
push:
branches:
- main
workflow_dispatch:
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v6
with:
tags: dockerhubusername/imagename:version
push: true
# No need to manually tag or push, it's handled in the build command above
Add the following secrets to your settings
this will enable github to auto push to github upon pushing
Hi, Unfortunately,this repo shouldn't be based with files people might not use. Not everyone will use docker, but at least everyone will use all NexoPOS internal files. Provide a repository for this Docker integration and we'll be glad to reference it in our documentation my.nexopos.com/en/documentation.
Thank you for your contribution.
Okay suure
** Currently supports queues