Git Product home page Git Product logo

docker-project's Introduction

Знакомство 👋

Всем привет! Меня зовут Владислав, я Solutions Architect и IT ментор живу в Москве. Занимаюсь проектированием: бизнес архитектуры, архитектуры данных, архитектуры приложения, технологической архитектуры, а также обучением сотрудников.

Имею более чем 10-летний опыт в IT, есть опыт запуска start-up и своего менторства. Обожаю развиваться сам и помогать другим 😎

МогуПомочь с созданием эффективного процесса управления командой, высоконагруженного проекта со сложной доменной областью.

  • Time management
  • People management
  • Product & Project management
  • Performance Review

Мой канал https://t.me/soprun_architect

soprun GitHub Stats

docker-project's People

Contributors

fossabot avatar soprun avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Forkers

fossabot

docker-project's Issues

GoAccess

https://goaccess.io

GoAccess был разработан как быстрый анализатор журналов на базе терминала. Его основная идея состоит в том, чтобы быстро анализировать и просматривать статистику веб-сервера в реальном времени без необходимости использования браузера ( отлично, если вы хотите быстро проанализировать журнал доступа через SSH или если вам просто нравится работать в терминале ).

PHP configuration: xdebug

  • Install php extension
  • add in docker-compose.yml for php & php-cli config

For macOS, if you use a local Homebrew php-fpm installation, port 9000 (which is the default debugging port) may become occupied.
PhpStorm will remain silent on starting listening for incoming connections.
If this is the case, in the Settings | Languages & Frameworks | PHP | Debug, set the Debug port to 9001, and use the following configuration line instead.

environment:
    - XDEBUG_CONFIG: remote_host=host.docker.internal, remote_port=9001

gwsocket.io

https://gwsocket.io/

Очень просто, просто перенаправьте вывод вашего приложения (stdout) в файл (именованный канал) и позвольте gwsocket передать данные в браузер - вот и все.

Nginx application Docker container

...

Nginx configuration

# docker/nginx/nginx.conf
worker_processes 4;

events { worker_connections 1024; }

http {
    server {
        listen 80;
        root  /usr/share/nginx/html;
        include /etc/nginx/mime.types;

        location /appui {
            try_files $uri /index.html;
        }
    }
}
# docker/nginx/service.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;
    }
}

PHP application Docker container

Structure multistage Docker build

PHP-Dockerfile use multi-stage builds.

  • stage: build (builder)
  • stage: dev (development)
  • stage: prod (production)

Build: app-cli-development

  • Symfony CLI
  • Composer CLI

Build: app-development

  • xdebug
  • php-coveralls
  • ca-certificates
  • git
  • bash
  • vim

Build: app-cli-production

  • ...
  • ...

Build: app-production

  • ...
  • ...
ARG APP_DIR
ARG APP_ENV
ARG APP_DEBUG
ARG APP_RELEASE
ARG APP_SECRET

#++++++++++++++++++++++++++++++++++++++
# PHP application Docker container
#++++++++++++++++++++++++++++++++++++++

# stage1 as builder
FROM php:7.4-alpine AS build

# installation system packages
RUN apk add --update --no-cache \
    bash

# copy php configuration
COPY ./docker/app/php.ini "${PHP_INI_DIR}/php.ini"

# change working directory
WORKDIR /app

# copy project file to workdir
COPY . .

# build project
RUN npm run build

# expose port outside
EXPOSE 9000

# run application
CMD ["php-fpm"]

#++++++++++++++++++++++++++++++++++++++
# PHP application Docker container
#++++++++++++++++++++++++++++++++++++++

FROM build AS development

FROM build AS production

#++++++++++++++++++++++++++++++++++++++
# PHP application Docker container
#++++++++++++++++++++++++++++++++++++++

# Production
FROM nginx

# copy needed files
COPY nginx.config /etc/nginx/conf.d/default.conf

# copy build files
COPY --from=base build /usr/share/nginx/html

# stage1 as builder
FROM node:10-alpine as builder

# copy the package.json to install dependencies
COPY package.json package-lock.json ./

# Install the dependencies and make the folder
RUN npm install && mkdir /react-ui && mv ./node_modules ./react-ui

WORKDIR /react-ui

COPY . .

# Build the project and copy the files
RUN npm run build


FROM nginx:alpine

#!/bin/sh

COPY ./.nginx/nginx.conf /etc/nginx/nginx.conf

## Remove default nginx index page
RUN rm -rf /usr/share/nginx/html/*

# Copy from the stahg 1
COPY --from=builder /react-ui/build /usr/share/nginx/html

EXPOSE 3000 80

ENTRYPOINT ["nginx", "-g", "daemon off;"]

PHP configuration: Timezone

For configuring Timezone you may use tzdata package which can be installed by running:

apk add tzdata

Timezone configuration

TIMEZONE="Europe/Helsinki"
cp /usr/share/zoneinfo/${TIMEZONE} /etc/localtime
echo "${TIMEZONE}" > /etc/timezone
sed -i "s|;*date.timezone =.*|date.timezone = ${TIMEZONE}|i" /etc/php7/php.ini

Insphpect

Insphpect - это автоматический инструмент проверки кода, который выявляет негибкость кода PHP и помогает вам писать более качественное программное обеспечение.

https://insphpect.com


Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.