-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(symfony4-php72) Refacto docker and docker-composee
- Loading branch information
1 parent
db7d86f
commit 55c0846
Showing
13 changed files
with
78 additions
and
277 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,48 +1,43 @@ | ||
version: '2' | ||
version: '3' | ||
|
||
services: | ||
postgres: | ||
image: postgres:9.6 | ||
ports: | ||
- ${POSTGRES_PORT}:5432 | ||
environment: | ||
POSTGRES_DB: ${POSTGRES_DB} | ||
POSTGRES_USER: ${POSTGRES_USER} | ||
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD} | ||
postgres: | ||
image: postgres:10 | ||
env_file: | ||
- .env | ||
ports: | ||
- ${POSTGRES_PORT}:5432 | ||
|
||
php: | ||
build: docker/php7-fpm | ||
env_file: ./.env | ||
volumes: | ||
- ${SYMFONY_APP_PATH}:/var/www/symfony | ||
links: | ||
- postgres | ||
php: | ||
build: | ||
context: . | ||
dockerfile: docker/php/Dockerfile | ||
env_file: | ||
- .env | ||
user: www-data | ||
working_dir: ${APP_DIR} | ||
volumes: | ||
- ${PWD}:${APP_DIR} | ||
|
||
nginx: | ||
build: docker/nginx | ||
ports: | ||
- ${WEB_PORT}:80 | ||
volumes_from: | ||
- php | ||
volumes: | ||
- ${LOGS_DIR}/nginx/:/var/log/nginx | ||
nginx: | ||
build: | ||
context: . | ||
dockerfile: docker/nginx/Dockerfile | ||
ports: | ||
- ${WEB_PORT}:80 | ||
volumes: | ||
- ${PWD}:${APP_DIR} | ||
|
||
elk: | ||
image: willdurand/elk | ||
ports: | ||
- ${ELK_PORT}:80 | ||
volumes: | ||
- ./docker/elk/logstash:/etc/logstash | ||
- ./docker/elk/logstash/patterns:/opt/logstash/patterns | ||
volumes_from: | ||
- php | ||
- nginx | ||
redis: | ||
image: redis:4 | ||
|
||
redis: | ||
image: redis:3.2.10 | ||
|
||
node: | ||
build: docker/node | ||
volumes: | ||
- ${SYMFONY_APP_PATH}:/var/www/symfony | ||
command: bash -c "yarn && yarn dev" | ||
node: | ||
build: | ||
context: . | ||
dockerfile: docker/node/Dockerfile | ||
env_file: | ||
- .env | ||
working_dir: ${APP_DIR} | ||
volumes: | ||
- ${PWD}:${APP_DIR} | ||
command: bash -c "yarn && yarn dev" |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,7 @@ | ||
FROM debian:jessie | ||
FROM nginx:1.13 | ||
|
||
MAINTAINER Maxence POUTORD <[email protected]> | ||
RUN rm -f /etc/nginx/nginx.conf /etc/nginx/conf.d/* | ||
|
||
RUN apt-get update && apt-get install -y \ | ||
nginx | ||
|
||
ADD nginx.conf /etc/nginx/ | ||
ADD symfony.conf /etc/nginx/sites-available/ | ||
|
||
RUN ln -s /etc/nginx/sites-available/symfony.conf /etc/nginx/sites-enabled/symfony | ||
RUN rm /etc/nginx/sites-enabled/default | ||
|
||
RUN echo "upstream php-upstream { server php:9000; }" > /etc/nginx/conf.d/upstream.conf | ||
|
||
RUN usermod -u 1000 www-data | ||
|
||
CMD ["nginx"] | ||
|
||
EXPOSE 80 | ||
EXPOSE 443 | ||
ADD ./docker/nginx/nginx.conf /etc/nginx/nginx.conf | ||
ADD ./docker/nginx/upstream.conf /etc/nginx/conf.d/upstream.conf | ||
ADD ./docker/nginx/symfony.conf /etc/nginx/conf.d/symfony.conf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,16 @@ | ||
server { | ||
server_name _; | ||
root /var/www/symfony/web; | ||
root /var/www/symfony/public; | ||
index index.php; | ||
|
||
location / { | ||
try_files $uri @rewriteapp; | ||
} | ||
|
||
location @rewriteapp { | ||
rewrite ^(.*)$ /app.php/$1 last; | ||
} | ||
|
||
location ~ ^/(app|app_dev|config)\.php(/|$) { | ||
location ~ \.php(/|$) { | ||
fastcgi_pass php-upstream; | ||
fastcgi_split_path_info ^(.+\.php)(/.*)$; | ||
include fastcgi_params; | ||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | ||
fastcgi_param HTTPS off; | ||
} | ||
|
||
error_log /var/log/nginx/symfony_error.log; | ||
access_log /var/log/nginx/symfony_access.log; | ||
error_log /var/www/symfony/var/log/nginx.error.log; | ||
access_log /var/www/symfony/var/log/nginx.access.log; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
upstream php-upstream { | ||
server php:9000; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
FROM node:8 | ||
FROM node:9 | ||
|
||
RUN apt-get update && \ | ||
apt-get install -y \ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
FROM php:7.2-fpm | ||
|
||
RUN apt-get update && \ | ||
apt-get install -y \ | ||
git \ | ||
unzip \ | ||
libpq-dev | ||
|
||
# Install Composer | ||
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer | ||
RUN composer --version | ||
RUN mkdir /var/www/.composer && chown -R www-data /var/www/.composer | ||
|
||
# Set timezone | ||
RUN rm /etc/localtime | ||
RUN ln -s /usr/share/zoneinfo/Europe/Paris /etc/localtime | ||
RUN "date" | ||
|
||
# Type docker-php-ext-install to see available extensions | ||
RUN docker-php-ext-install pdo_pgsql | ||
|
||
RUN usermod -u 1000 www-data | ||
|
||
WORKDIR /var/www/symfony |
Oops, something went wrong.