Skip to content

Instantly share code, notes, and snippets.

View Neirda24's full-sized avatar
🍺
🍺

Adrien Roches Neirda24

🍺
🍺
View GitHub Profile
@Neirda24
Neirda24 / docker-compose.local.traefik.yml
Last active October 18, 2022 10:40
multiple docker-compose structure (light)
services:
nginx:
networks:
traefik:
aliases:
- 'local.app'
labels:
traefik.enable: 'true'
traefik.http.services.myapp.loadbalancer.server.port: '80'
traefik.http.routers.myapp.rule: 'Host(`local.app`)'
@Neirda24
Neirda24 / functions.sh
Last active November 16, 2022 12:17
Seamless docker integration
#!/usr/bin/env bash
## ---------------
## Setup
## ---------------
CURRENT_BASH=$(ps -p $$ | tail -n 1 | awk '{ print $4 }' | perl -pe 's#.*[-/](\w)#$1#');
case "${CURRENT_BASH}" in
zsh)
CURRENT_DIR=$(cd "$(dirname "${0}")" && pwd);
;;
NGROK_AUTH=My_auth_token
@Neirda24
Neirda24 / README.md
Created May 1, 2020 08:57
Seemless use of docker

Usage

$ # Depending on your terminal (sh, bash, zsh) it may display errors or warning. But it will work ;)
$ source ./functions.sh
$ php --version # execute php inside the container and accept any arguments
$ dev # execute the symfony console on dev mode and accept any arguments
FROM scratch as app
WORKDIR /app
COPY . .
RUN chmod +x docker-entrypoint.sh
FROM whatever
@Neirda24
Neirda24 / OverrideFosRestServicesPass.php
Created November 29, 2018 14:31
Override service with CompilerPass
<?php
class OverrideFosRestServicesPass implements CompilerPassInterface
{
/**
* {@inheritdoc}
*/
public function process(ContainerBuilder $container)
{
if ($container->hasDefinition('fos_rest.exception_listener')) {
@Neirda24
Neirda24 / 1-Dockerfile.common
Created February 5, 2018 17:10
usecase for include
ARG SOURCE=mysource
FROM ${CODE_VERSION}
#some common actions
RUN ...
@Neirda24
Neirda24 / GuzzleClientAware.php
Last active January 15, 2018 16:32
Sample of how I mocked EightPoints guzzle Clients
<?php
use GuzzleHttp\HandlerStack;
use GuzzleHttp\Promise\FulfilledPromise;
use GuzzleHttp\Psr7\Response;
use InvalidArgumentException;
use Psr\Container\ContainerInterface;
use Psr\Http\Message\RequestInterface;
use Symfony\Component\Finder\Finder;
use Symfony\Component\Finder\SplFileInfo;