soprun / docker-project Goto Github PK
View Code? Open in Web Editor NEWPHP-project using docker containers - sandbox
PHP-project using docker containers - sandbox
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 - это автоматический инструмент проверки кода, который выявляет негибкость кода PHP и помогает вам писать более качественное программное обеспечение.
shellcheck --external-sources build.sh
Очень просто, просто перенаправьте вывод вашего приложения (stdout) в файл (именованный канал) и позвольте gwsocket передать данные в браузер - вот и все.
ENV LANG=en_US.UTF-8
ENV LANGUAGE=en_US.UTF-8
ENV LC_ALL=en_US.UTF-8
...
# 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;
}
}
GoAccess был разработан как быстрый анализатор журналов на базе терминала. Его основная идея состоит в том, чтобы быстро анализировать и просматривать статистику веб-сервера в реальном времени без необходимости использования браузера ( отлично, если вы хотите быстро проанализировать журнал доступа через SSH или если вам просто нравится работать в терминале ).
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
PHP-Dockerfile use multi-stage builds.
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;"]
ENV TZ=UTC
code-inspector.com
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.