Documentaçao Docker Install
Documentaçao Docker Install
Documentaçao Docker Install
PROJETOS
app.dockerfile
FROM php:8.0-fpm
WORKDIR /var/www
RUN docker-php-ext-install bcmath
RUN apt-get update && apt-get install -y \
libfreetype6-dev \
libjpeg-dev \
libpng-dev \
libwebp-dev \
--no-install-recommends \
&& docker-php-ext-configure gd --with-freetype --with-jpeg \
&& docker-php-ext-install pdo_mysql -j$(nproc) gd
ADD . /var/www
RUN chown -R www-data:www-data /var/www
web.dockerfile
FROM nginx:1.21
vhost.conf
server {
listen 80;
index index.php index.html;
root /var/www/public;
location / {
try_files $uri /index.php?args;
}
location ~ \.php$ {
fastcgi_split_path_info ˆ(.+\.php)(/.+)$;
fastcgi_pass app:9000;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
}
}
Sem banco
docker-compose.yaml
version: '3.7'
services:
app:
build:
context: .
dockerfile: app.dockerfile
working_dir: /var/www
volumes:
- ./:/var/www
web:
build:
context: .
dockerfile: web.dockerfile
working_dir: /var/www
volumes:
- ./:/var/www
depends_on:
- "app"
ports:
- 8080:80
apos Criar
services:
app:
build:
context: .
dockerfile: app.dockerfile
working_dir: /var/www
volumes:
- ./:/var/www
web:
build:
context: .
dockerfile: web.dockerfile
working_dir: /var/www
volumes:
- ./:/var/www
depends_on:
- "app"
ports:
- 8080:80
db:
image: mysql:latest
environment:
MYSQL_DATABASE: 'laravel_db'
MYSQL_USER: 'laravel_user'
MYSQL_PASSWORD: 'Laravel'
MYSQL_ROOT_PASSWORD: 'Laravel'
ports:
- "6033:3306"
expose:
- "6033"
volumes:
- ./my-db:/var/lib/mysql
phpmyadmin:
image: phpmyadmin/phpmyadmin:latest
links:
- db
environment:
PMA_ARBITRARY: 1
volumes:
- ./php-make/upload.ini:/usr/local/etc/php/php.ini
ports:
- 13306:80
volumes:
my-db:
networks:
default:
external:
name: localdev
Docker REACT JS
Comandos para gerar images e fazer push e pull aos repositorios do docker-hub
Docker-compose Sonarqube
criar un arquivo docker-compose.yml
version: '3.7'
services:
jenkins:
image: jenkins/jenkins:lts
ports:
- "8189:8189"
- "50000:50000"
networks:
- jenkins
volumes:
- /var/jenkins_home:/var/jenkins_home
- /var/run/docker.sock:/var/run/docker.sock
postgres:
image: postgres:9.6
networks:
- jenkins
environment:
POSTGRES_USER: sonar
POSTGRES_PASSWORD: sonarpasswd
volumes:
- /var/postgres-data:/var/lib/postgresql/data
sonarqube:
image: sonarqube:lts
ports:
- "9000:9000"
- "9092:9092"
networks:
- jenkins
environment:
SONARQUBE_JDBC_USERNAME: sonar
SONARQUBE_JDBC_PASSWORD: sonarpasswd
SONARQUBE_JDBC_URL: "jdbc:postgresql://postgres:5432/sonar"
depends_on:
- postgres
networks:
jenkins:
adicionar Network
https://github.com/docker/for-linux/issues/418
$ cat docker-compose.override.yml
version: '3'
networks:
default:
external:
name: localdev
Estructura Docker para site HTML, CSS, JAVASCRIPT
docker-compose.yml
version: '3'
services:
proxy:
image: intergalaxy-test-nginx
build:
context: .
ports:
- "80:80"
networks:
default:
external:
name: localdev3
Dockerfile
FROM nginx:alpine
COPY ./ /usr/share/nginx/html
ERROS
Error Clase nao encontrada Jensseger quando no local funciona e no servidor não
Solução:
1. Remova completamente a pasta vendor/jenssegers
2. Na linha de comando (cmd), vá para a pasta do projeto (laravel-master)
3. Execute o comando composer selfupdate para atualizar o seu composer
4. Execute o comando composer require jenssegers/agent
5. Se o comando acima falhar, acrescente "jenssegers/agent": "*" na seção require
do seu arquivo composer.json, caso ainda não esteja lá
6. Execute o comando composer update -o jenssegers/agent
https://pt.stackoverflow.com/questions/6086/classe-n%C3%A3o-encontrada-mas-em-outro-p
rojeto-funcionava