File tree Expand file tree Collapse file tree 19 files changed +102
-298
lines changed Expand file tree Collapse file tree 19 files changed +102
-298
lines changed Original file line number Diff line number Diff line change 1
1
# APP
2
- SYMFONY_APP_PATH=/
2
+ APP_DIR=/var/www/symfony
3
3
4
- # DOCKER
5
- LOGS_DIR=/docker/logs
4
+ # Symfony
5
+ APP_ENV=dev
6
+ APP_DEBUG=1
7
+ SECRET=
8
+
9
+ # NODE
10
+ NODE_ENV=dev
6
11
7
12
# DATABASE
13
+ POSTGRES_HOST=
8
14
POSTGRES_DB=
9
15
POSTGRES_USER=
10
16
POSTGRES_PASSWORD=
11
17
POSTGRES_PORT=
12
18
13
- # PORT WEB
14
- WEB_PORT=
15
- ELK_PORT=
16
-
17
- # SYMFONY
18
- SECRET=
19
-
20
19
#SMTP
21
20
SMTP_USER=
22
21
SMTP_PASSWORD=
23
22
SMTP_HOST=
24
23
SMTP_TRANSPORT=
25
24
25
+ # PORT WEB
26
+ WEB_PORT=
27
+
26
28
#REDIS
27
29
REDIS_DSN=
Original file line number Diff line number Diff line change 21
21
# ## PHPUnit
22
22
/phpunit.xml
23
23
24
- # ## Docker
25
- docker /logs /
26
-
27
24
# ## NodeJS - NPM - YARN
28
25
node_modules /
29
26
npm-debug.log *
Original file line number Diff line number Diff line change @@ -86,8 +86,8 @@ snc_redis:
86
86
type : predis
87
87
logging : false
88
88
alias : session_client
89
- dsn : %redis_dsn%
90
- options : %redis_options%
89
+ dsn : ' %redis_dsn%'
90
+ options : ' %redis_options%'
91
91
session :
92
92
client : session_client
93
93
prefix : app_session_
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ parameters:
7
7
database_password : ' %env(POSTGRES_PASSWORD)%'
8
8
9
9
# Mailer parameters
10
- mailer_transport : %env(SMTP_TRANSPORT)%
10
+ mailer_transport : ' %env(SMTP_TRANSPORT)%'
11
11
mailer_host : ' %env(SMTP_HOST)%'
12
12
mailer_user : ' %env(SMTP_USER)%'
13
13
mailer_password : ' %env(SMTP_PASSWORD)%'
@@ -16,6 +16,6 @@ parameters:
16
16
secret : ' %env(SECRET)%'
17
17
18
18
# Redis parameters
19
- redis_dsn : ' %env(REDIS_DSN)%'
19
+ redis_dsn : ' redis:// %env(REDIS_DSN)%'
20
20
redis_options : ~
21
21
session_ttl : 86400
Original file line number Diff line number Diff line change @@ -53,10 +53,10 @@ stop ()
53
53
docker-compose stop
54
54
}
55
55
56
- # run bash
57
- bash ()
56
+ # run sh
57
+ sh ()
58
58
{
59
- docker-compose exec --user www-data php bash
59
+ docker-compose exec --user www-data php sh
60
60
}
61
61
62
62
# exec a command into app container (as root)
@@ -105,7 +105,7 @@ usage ()
105
105
init Initialize project
106
106
start Start project
107
107
stop Stop project
108
- bash Use bash inside the app container
108
+ sh Use sh inside the app container
109
109
exec Executes a command inside the app container
110
110
destroy Remove all the project Docker containers with their volumes
111
111
console Use the Symfony console
@@ -123,7 +123,7 @@ main ()
123
123
exit 0
124
124
fi
125
125
126
- if [[ ! $1 =~ ^init| start| stop| bash | destroy| console| composer| exec| tests$ ]]; then
126
+ if [[ ! $1 =~ ^init| start| stop| sh | destroy| console| composer| exec| tests$ ]]; then
127
127
echo " $1 is not a supported command"
128
128
exit 1
129
129
fi
Original file line number Diff line number Diff line change 1
- version : ' 2 '
1
+ version : ' 3 '
2
2
3
3
services :
4
- postgres :
5
- image : postgres:9.6
6
- ports :
7
- - ${POSTGRES_PORT}:5432
8
- environment :
9
- POSTGRES_DB : ${POSTGRES_DB}
10
- POSTGRES_USER : ${POSTGRES_USER}
11
- POSTGRES_PASSWORD : ${POSTGRES_PASSWORD}
4
+ postgres :
5
+ image : postgres:10-alpine
6
+ env_file :
7
+ - .env
8
+ ports :
9
+ - ${POSTGRES_PORT}:5432
12
10
13
- php :
14
- build : docker/php7-fpm
15
- env_file : ./.env
16
- volumes :
17
- - ${PWD}:/var/www/symfony
18
- links :
19
- - postgres
11
+ php :
12
+ build :
13
+ context : .
14
+ dockerfile : docker/php/Dockerfile
15
+ env_file :
16
+ - .env
17
+ user : www-data
18
+ working_dir : ${APP_DIR}
19
+ volumes :
20
+ - ${PWD}:${APP_DIR}
20
21
21
- nginx :
22
- build : docker/nginx
23
- ports :
24
- - ${WEB_PORT}:80
25
- volumes_from :
26
- - php
27
- volumes :
28
- - ${LOGS_DIR}/nginx/:/var/log/nginx
22
+ nginx :
23
+ build :
24
+ context : .
25
+ dockerfile : docker/nginx/Dockerfile
26
+ ports :
27
+ - ${WEB_PORT}:80
28
+ volumes :
29
+ - ${PWD}:${APP_DIR}
29
30
30
- elk :
31
- image : willdurand/elk
32
- ports :
33
- - ${ELK_PORT}:80
34
- volumes :
35
- - ./docker/elk/logstash:/etc/logstash
36
- - ./docker/elk/logstash/patterns:/opt/logstash/patterns
37
- volumes_from :
38
- - php
39
- - nginx
31
+ redis :
32
+ image : redis:4-alpine
40
33
41
- redis :
42
- image : redis:3.2.10
43
-
44
- node :
45
- build : docker/node
46
- volumes :
47
- - ${SYMFONY_APP_PATH}:/var/www/symfony
48
- command : bash -c "yarn && yarn dev"
34
+ node :
35
+ image : node:9
36
+ user : node
37
+ working_dir : ${APP_DIR}
38
+ volumes :
39
+ - ${PWD}:${APP_DIR}
40
+ command : bash -c "yarn && yarn dev"
Load Diff This file was deleted.
Load Diff This file was deleted.
Load Diff This file was deleted.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1
- FROM debian:jessie
1
+ FROM nginx:1.13-alpine
2
2
3
- MAINTAINER Maxence POUTORD <maxence.poutord@gmail.com>
3
+ RUN apk --no-cache add shadow
4
4
5
- RUN apt-get update && apt-get install -y \
6
- nginx
5
+ RUN rm -f /etc/nginx/nginx.conf /etc/nginx/conf.d/*
7
6
8
- ADD nginx.conf /etc/nginx/
9
- ADD symfony.conf /etc/nginx/sites-available/
7
+ ADD ./docker/nginx/nginx.conf /etc/nginx/nginx.conf
8
+ ADD ./docker/nginx/upstream.conf /etc/nginx/conf.d/upstream.conf
9
+ ADD ./docker/nginx/symfony.conf /etc/nginx/conf.d/symfony.conf
10
10
11
- RUN ln -s /etc/nginx/sites-available/symfony.conf /etc/nginx/sites-enabled/symfony
12
- RUN rm /etc/nginx/sites-enabled/default
13
-
14
- RUN echo "upstream php-upstream { server php:9000; }" > /etc/nginx/conf.d/upstream.conf
15
-
16
- RUN usermod -u 1000 www-data
17
-
18
- CMD ["nginx" ]
19
-
20
- EXPOSE 80
21
- EXPOSE 443
11
+ RUN addgroup -g 1000 -S www-data && \
12
+ adduser -u 1000 -D -S -G www-data www-data
Original file line number Diff line number Diff line change 25
25
include /etc/nginx/sites-enabled/*;
26
26
open_file_cache max=100;
27
27
}
28
-
29
- daemon off ;
You can’t perform that action at this time.
0 commit comments