Skip to content

Instantly share code, notes, and snippets.

@cgiovanii
Last active June 12, 2019 23:00
Show Gist options
  • Save cgiovanii/9cbca155ef31d24b4ad867511a494f67 to your computer and use it in GitHub Desktop.
Save cgiovanii/9cbca155ef31d24b4ad867511a494f67 to your computer and use it in GitHub Desktop.
Stack Development Web

Criei este Stack para facilitar o meu workflow.

**Ferramentas utilizadas:

Docker CE,
Yarn,
Nodejs,
Php7.2-cli(php-mcript, mysqli, gd, pdo, composer),
vscode,
Git(Gitkraken, bitbucket),

**Para instalar o Docker:

https://docs.docker.com/install/linux/docker-ce/ubuntu/

**Para instalar o docker-compose:

https://docs.docker.com/compose/install/

**Para instalar o docker-machine:

https://docs.docker.com/machine/install-machine/

base=https://github.com/docker/machine/releases/download/v0.16.0 && curl -L $base/docker-machine-$(uname -s)-$(uname -m) >/tmp/docker-machine && sudo mv /tmp/docker-machine /usr/local/bin/docker-machine

Nota: mudar as permissoes do docke-machine para 755

**Para instalar o aws-cli:

sudo apt install python-pip && pip install awscli

**Para instalar o Composer:

https://getcomposer.org/doc/00-intro.md

**Para instalar o xdebug:

sudo apt install php-xdebug

sudo nano /etc/php/7.2/mods-available/xdebug.ini

Depois cole as seguintes linhas:

zend_extension=/usr/lib/php/20170718/xdebug.so
xdebug.remote_autostart = 1
xdebug.remote_enable = 1
xdebug.remote_handler = dbgp
xdebug.remote_host = 127.0.0.1
xdebug.remote_log = /tmp/xdebug_remote.log
xdebug.remote_mode = req
xdebug.remote_port = 9005 #if you want to change the port you can change

**Para instalar o vscode:

https://snapcraft.io/code

**Para instalar o Nodejs:

https://github.com/nodesource/distributions/blob/master/README.md

**Para instalar o Yarn:

https://yarnpkg.com/en/docs/install#debian-stable

Docker Lamp stack:

mkdir projeto && cd projeto && mkdir mysql html

touch /html/index.php Dockerfile docker-compose.yml

Elementary

` sudo add-apt-repository ppa:philip.scott/elementary-tweaks

php:
build: .
ports:
- "80:80"
- "443:443"
volumes:
- ./html:/var/www/html
db:
image: mysql:5.7
volumes:
- ./mysql:/var/lib/mysql
environment:
- MYSQL_ROOT_PASSWORD=password
- MYSQL_DATABASE=mydb
#docker-compose para correr o lamp
version: '3.3'
services:
db:
image: mysql:5.7
volumes:
- ./mysql:/var/lib/mysql
ports:
- "3306:3306"
environment:
MYSQL_ROOT_PASSWORD: password
MYSQL_DATABASE: mydb
MYSQL_USER: user
MYSQL_PASSWORD: userpass
php:
depends_on:
- db
image: cursos_php:latest
ports:
- "80:80"
- "443:443"
volumes:
- "./html:/var/www/html"
pma:
depends_on:
- db
image: phpmyadmin/phpmyadmin
ports:
- 8080:80
environment:
PMA_HOST: db:3306
MYSQL_ROOT_PASSWORD: password
volumes:
mysql:
FROM php:7.2-apache
RUN apt-get update && apt-get install -y \
libfreetype6-dev \
libjpeg62-turbo-dev \
libpng-dev \
libmcrypt-dev \
&& pecl install mcrypt-1.0.1 \
&& docker-php-ext-enable mcrypt \
&& docker-php-ext-install -j$(nproc) iconv \
&& docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \
&& docker-php-ext-install -j$(nproc) gd mysqli mbstring pdo pdo_mysql
RUN a2enmod rewrite
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment