Deploy Laravel docker project on a Linux server - laravel

I'm working on Laravel projects with Docker containers (Php-FPM, Nginx, xdebug, ...) under Windows OS + Netbeans. Docker simplifies life for all projects at start.
But as many, I need to frequently deploy my work on internal TEST servers (centOS 8) and further on PROD servers (centOS 8).
Repo are on SASS GitLab.
What can you advise me as a method for deploying my laravel projects with docker containers on TEST / PROD servers knowing that they are under centOS and that my Docker containers works on a Linux OS that escapes me.
Are there any compatibility issues between docker containers and another OS Linux Server?
Should I create SSH tunnels to execute Rsync scripts from Windows (DEV) to Linux (TEST & PROD) to deploy my projects?
What are the up to date methods?
MAJ : My wishes would be to reuse docker containers on TEST a PROD centOS servers in order to benefit without have to reconfigure any web servers and so on ...
Thanks for your help,
Best regards

Related

Deploy docker contained backend on windows 11 by single file click

The task is - deploy Django rest backend via docker on clean Windows 11. It must be done by client clicking single application / bat file. Everything should be installed and set up automatically.
Docker related files are set up okay and test backend works well on ubuntu machine. But how to do automatic deploy on windows?
Using virtual machine with linux is not accepted as well.

Run Quarkus tests with TestContainers using WSL2 + Podman

With the license change for Docker Desktop on Windows, I'm looking for an alternative. Podman + WSL2 seems to do the trick for me. Except for Testcontainers in my Quarkus tests.
I'm able to run my tests within WSL2 by starting podman system service in WSL2 (podman system service -t 0 tcp:localhost:8880) and setting the DOCKER_HOST env var (DOCKER_HOST=tcp://localhost:8880).
Now this works, but isn't really what I need, since at my company we develop in VSCode, IntelliJ and Eclipse. I'd like to be able to run the tests from within those IDE's. Is there any way to pass the podman uri (from WSL) to my IDE in Windows while running Quarkus tests?
If anyone would know any other docker desktop alternatives that work with TestContainers, that would be awesome as well. I have tried Rancher Desktop, but it gets stuck and the tests eventually time out.
You have to install podman-remote packages on your windows host machine, then configure it to use tcp://WSL2_IP:8880 (podman documentation) and finally make an alias for the program docker -> podman.exe.
Now you are able to run docker commands as usual... docker ps docker run etc. But it does not mean that all tools will work out of the box. You have to tune it.
For example for testcontainers you have to set env variables on host machine:
PowerShell
[System.Environment]::SetEnvironmentVariable("DOCKER_HOST", "tcp://WSL2_IP:8880", [System.EnvironmentVariableTarget]::User)
[System.Environment]::SetEnvironmentVariable("TESTCONTAINERS_CHECKS_DISABLE", "True", [System.EnvironmentVariableTarget]::User)
[System.Environment]::SetEnvironmentVariable("TESTCONTAINERS_RYUK_DISABLED", "True", [System.EnvironmentVariableTarget]::User)
P.S. All that kind of variables were set for you by docker, but from now you have to do it by yourself.
We ran the testcontainers-java tests using various solutions for Docker.
I don't know if running in WSL changes a lot compared to the Windows only setup.
In general, Testcontainers doesn't rely only on the CLI commands only and works best with compatible Docker environments. Based on the findings in that experiment, you can try minikube.
enter image description hereTake IntelliJ for example, you can set DOCKER_HOST env var by "Run/Debug Configurations" and it works perfectly.

Jenkins through docker: How to configure own host as agent for jenkins?

I'm using Jenkins with pipelines on a mac-mini. All builds are working fine with docker agents (backend, frontend, android app, etc)
The only thing I haven't been able to achieve is to use my own mac-mini as build-agent/slave for the IOS app (I need to build on OSX). Jenkins itself runs through docker as well, so I would need to connect to the host (the OS of the mac-mini) and use that as an agent...
I know one option would be to install jenkins instead of using docker, but I would prefer to keep Jenkins running in a docker container.
Does someone has experience with this or knows any good documentation on how to set this up?
Go to Manage Jenkins > Manage Nodes > New Node.
Configure a node.
Go to the list of nodes.
Select your newly configured node. It should be offline at this moment.
Run the java command displayed on the interface on your host machine.
Your Host machine is now a slave.

What is the best practices of using Docker for front end development on OS X and passthrough ENV from host to container

I am looking for best practices about front-end developing on OSX with docker and I have found number of projects on github. Here they are:
docker-osx-dev
boot2docker-xhyve
coreos-xhyve
docker-unison
hodor
The fact is I need two-way syncing files from host system to virtual container and vice versa via mounted (synced) folder and IO performance should be like native one. Therefore I don't consider shared folders FS like vboxsf and vmhgfs. Also it's needed to have some build tools (gulp etc) with working wathcer within shared folder.
What do you think about xhyve (with NFS) instead of VirtualBox? Who tried the unison, what the performance docker provides with it?
At last I have a special task I want to run app.js via nodejs through host to container ENV if it is possible. In other words I have to add ENV variable for PATH to nodejs (within virtual container) to my ~/.bash_profile. Is there any chance to do passthrough NODE_PATH from host to container at all?
Thanks.
Not sure if "best practice" is asking for opinions (which is against SO policy), note that this also heavily depends on your tools chain.
I'm not a fan of boot2docker as it works to date (although it may improve and it may be the best approach in the long term as it is the official approach maintained by the docker team).
EDIT: boot2docker was discontinued and replaced by Docker Machine which does pretty much the same thing but in a more generic way, allowing you to manage Docker daemons locally, in LAN or in the cloud.
For Me, I'm on Windows, but I face the same (even more) difficulties as OSX devs. As I'm using Hyper-V, boot2docker (VirtualBox) can't run, so I have to roll my own. Also, last time I tried boot2docker - it ran TinyCoreLinux, which is another Linux distribution I'd have to learn while my focus is CoreOS in the cloud, so I'd rather just focus on CoreOS.
The target for setting up your dev is as follows:
Have ssh access with mounting rights to a docker host (either in VM or on LAN): this is CoreOS on Hyper-V for me.
Have a native docker client & export DOCKER_HOST=<ip or hostname here>
mount /mnt/from/host working directory into your docker host for live reload: this works through mount.cifs on CoreOS with a systemd unit for me.
Make dev.Dockerfile for your dev requirements, if you're a node developer, start from the node image, npm install gulp/browserify/.. whatever you need as a base image for your projects & docker build -f dev.Dockerfile -t my_dev_container .
docker run -it -v /mnt/from/host/:/src/app/ -e my_dev_container
You are now in a terminal with a fully isolated environment which can be put under source control & replicated between project members and has full live reload abilities.
Draw backs: if you rely on REPL or intelliSense from your IDE, you'll have to have an IDE that can use the remote server. Or you have to run your IDE within the dev container (cloud9 or use X server).
Of course if you live in a terminal and are fluent in vim, you are good to go.

Jenkins Master on VM Linux Centos and Jenkins Slave on VM Windows 7

Texte d'origine Ecoutez le texte source
Hi
Please, can you give me your opinions about this subject :
1.I have instaled Jenkins on VM Linux Centos
2.I have installed Jenkins on VM Windows 7 which contains the project Java Maven.
3.I shared the project from VM Windows 7 to VM Linux Centos and I succed to the project from my VM Linux
My goal is to make Jenkins Master on VM linux and Jenkins slave on VM Windows.
What I should do for creating the communication between all jenkins.
Thanks in Advance.
Best Regards,
Two ways of making a Windows slave (after defining nodes on master), on Windows server:
-browse to Jenkins node listing and launch web agent (Java Web Start) which has to be done manually each time the server starts up
-after starting the agent, register the slave as a service
Plenty of documentation, I found this just now.
Definitely prefer a service you don't have to worry about the web agent dying for some unknown reason and no one noticing, much better to have it auto start.

Resources