ECCENTRIC DEVELOPER
Oscar Fanelli
Full-stack developer
Zend Framework
Doctrine
ReactJS
Tom's Hardware
Uala (Immobiliare.it)
Docker
PhpStorm
per gli anti-google
(quando diventerò famoso)
MAMP
Brew
brew update && brew upgrade...
% /usr/local/bin/gpg1
dyld: Library not loaded: /usr/local/opt/libusb-compat/lib/libusb-0.1.4.dylib
Referenced from: /usr/local/bin/gpg1
Reason: image not found
[1] 41295 trace trap /usr/local/bin/gpg1
error: unable to unlink old '.gitignore' (Permission denied)
error: unable to create file .travis.yml (Permission denied)
error: unable to create file .yardopts (Permission denied)
error: unable to unlink old 'CODEOFCONDUCT.md' (Permission denied) ...
npm ERR! Darwin 13.3.0
npm ERR! argv "node" "/Users/user/.node/bin/npm" "update" "-g"
npm ERR! node v0.10.32
npm ERR! npm v2.0.0
npm ERR! code EPEERINVALID
npm ERR! peerinvalid The package npmconf does not satisfy its siblings' peerDependencies requirements!
npm ERR! peerinvalid Peer npm-registry-client@3.2.2 wants npmconf@^2.1.0
Vagrant
devops...
Dockerfile
FROM ubuntu:16.04
MAINTAINER Oscar Fanelli <oscar.fanelli@gmail.com>
ENV PROJECT_PATH=/var/www \
DEBIAN_FRONTEND=noninteractive
# Utilities, Apache, PHP, and supplementary programs
RUN apt-get update -q && apt-get upgrade && apt-get install -yqq --force-yes \
npm \
git \
wget \
apache2 \
libapache2-mod-php \
php \
php-curl \
php-mysql \
php-redis \
php-xml
# Apache mods
RUN a2enmod rewrite expires headers
# PHP.ini file: enable <? ?> tags and quiet logging
RUN sed -i "s/short_open_tag = .*/short_open_tag = On/" $PHP_INI && \
sed -i "s/memory_limit = .*/memory_limit = 256M/" $PHP_INI
# VirtualHost
COPY config/docker/apache-virtualhost.conf /etc/apache2/sites-available/000-default.conf
# Port to expose
EXPOSE 80
# Copy site into place
COPY . $PROJECT_PATH
WORKDIR $PROJECT_PATH
# Start apache
CMD /usr/sbin/apache2ctl -D FOREGROUND
Docker Compose
version: '2'
services:
db:
image: mysql:5.7.17
volumes:
- "./.data/db:/var/lib/mysql"
environment:
MYSQL_ROOT_PASSWORD: secret
expose:
- "3306"
redis:
image: redis
phpmyadmin:
image: phpmyadmin/phpmyadmin
depends_on:
- db
web:
build:
context: .
dockerfile: Dockerfile
volumes:
- ".:/var/www/"
depends_on:
- db
- redis
env_file: .env
Mount db dentro cartella del progetto
version: '2'
services:
db:
image: mysql:5.7.17
volumes:
- "./.data/db:/var/lib/mysql"
environment:
MYSQL_ROOT_PASSWORD: secret
expose:
- "3306"
Alias
alias d-up="docker-compose -f docker-compose_development.yml up -d"
alias d-down="docker-compose -f docker-compose_development.yml down"
alias d-bash="docker-compose -f docker-compose_development.yml exec web bash"
alias docker-dangling-volumes-remove="docker volume rm \$(docker volume ls -qf dangling=true)"
alias docker-stop-all-containers="docker stop \$(docker ps -a -q)"
alias docker-rm-all-containers="docker rm \$(docker ps -a -q)"
alias free-port80="sudo launchctl unload /System/Library/LaunchDaemons/org.apache.httpd.plist"
d4m-nfs
alias d-nfs-run="~/Sites/d4m-nfs/d4m-nfs.sh"
alias d-up="docker-compose -f docker-compose_development.yml up -d"
alias d-setup="d-nfs-run && d-up"
https://github.com/IFSight/d4m-nfs
Immagine base
FROM ubuntu:16.04
ENV PHP_INI=/etc/php/7.0/apache2/php.ini
RUN apt-get update -q && apt-get upgrade -yqq && apt-get install -yqq \
apache2 \
libapache2-mod-php \
php
RUN sed -i "s/short_open_tag = .*/short_open_tag = On/" $PHP_INI
EXPOSE 80
CMD /usr/sbin/apache2ctl -D FOREGROUND
FROM pensiero/apache2-php
RUN apt-get install -yqq \
php-mysql
EXPOSE 80
CMD /usr/sbin/apache2ctl -D FOREGROUND
Upgrade da PHP 5.6 a 7.0
Docker HUB
Jenkins
GitHub
Rancher