Skip to content

Commit 6116ae9

Browse files
author
vsilent
committed
run php procs under 2000:2000
1 parent 29aec45 commit 6116ae9

File tree

7 files changed

+40
-11
lines changed

7 files changed

+40
-11
lines changed

.env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ DOMAIN=
44
APP_ENV=dev
55
APP_SECRET={{APP_SECRET}}
66
DATABASE_URL=mysql://symfony:symfony@db:3306/symfony
7-
LOCAL_USER=1001:1001
7+
LOCAL_USER=2000:2000
88

99
#filebeat
1010
FILEBEAT_HOST=localhost

README.md

Lines changed: 35 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
1-
[![Build Status](https://travis-ci.com/trydirect/symfony-restful.svg?branch=master)](https://travis-ci.com/trydirect/symfony-restful)
1+
[![Build Status](https://travis-ci.com/trydirect/symfony4-restful.svg?branch=master)](https://travis-ci.com/trydirect/symfony4-restful)
22
![Docker Stars](https://img.shields.io/docker/stars/trydirect/symfony4-restful.svg)
33
![Docker Pulls](https://img.shields.io/docker/pulls/trydirect/symfony4-restful.svg)
44
![Docker Automated](https://img.shields.io/docker/cloud/automated/trydirect/symfony4-restful.svg)
55
![Docker Build](https://img.shields.io/docker/cloud/build/trydirect/symfony4-restful.svg)
66
[![Gitter chat](https://badges.gitter.im/trydirect/community.png)](https://gitter.im/try-direct/community)
77

8-
# symfony4-restful
9-
RESTfull API template based on Symfony 4 for development purpose
8+
# Symfony4-RESTful development template
9+
10+
RESTfull API development template based on Symfony 4 for development purpose
11+
12+
## Stack includes
1013
* PHP-fpm 7.2.11
1114
* Rest API
1215
* MySQL 5.7
@@ -31,14 +34,37 @@ $ pip install docker-compose
3134
## Installation
3235
Clone this project into your work directory:
3336
```sh
34-
$ git clone "https://github.com/trydirect/symfony4-restful.git"
37+
$ git clone https://github.com/trydirect/symfony4-restful.git
3538
```
3639
Then build it via docker-compose:
3740
```sh
3841
$ cd symfony4-restful
3942
$ docker-compose up -d
4043
```
4144

45+
## Configuration
46+
47+
```
48+
docker exec web composer install
49+
```
50+
51+
Now, let's check the result
52+
```
53+
$ curl http://localhost/
54+
55+
url -i localhost
56+
HTTP/1.1 200 OK
57+
Server: nginx/1.14.2
58+
Content-Type: application/json
59+
Transfer-Encoding: chunked
60+
Connection: keep-alive
61+
X-Powered-By: PHP/7.2.11
62+
Cache-Control: no-cache, private
63+
Date: Fri, 24 May 2019 16:45:55 GMT
64+
65+
{"id":"s","name":"Test","description":"Description"}
66+
```
67+
4268

4369
# Contributing
4470

@@ -47,3 +73,8 @@ $ docker-compose up -d
4773
3. Commit your changes (git commit -am 'Add some fooBar')
4874
4. Push to the branch (git push origin feature/fooBar)
4975
5. Create a new Pull Request
76+
77+
78+
#Support Development
79+
80+
[![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=2BH8ED2AUU2RL)

configs/php/www.conf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020
; Unix user/group of processes
2121
; Note: The user is mandatory. If the group is not set, the default user's group
2222
; will be used.
23-
user = www-data
24-
group = www-data
23+
user = trydirect
24+
group = trydirect
2525

2626
; The address on which to accept FastCGI requests.
2727
; Valid syntaxes are:

docker-compose-build.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ services:
1212
build: dockerfiles/build
1313
restart: always
1414
container_name: php
15-
user: 1001:1001
1615
links:
1716
- db
1817
working_dir: /var/www/html

docker-compose.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ services:
1111
image: trydirect/symfony4-restful:latest
1212
restart: always
1313
container_name: php
14-
user: 1001:1001
1514
links:
1615
- db
1716
working_dir: /var/www/html

dockerfiles/build/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,6 @@ RUN cd xdebug-2.6.1 \
5353
&& echo 'xdebug.max_nesting_level=512' >> /usr/local/etc/php.ini \
5454
&& echo 'extension=xdebug.so' >> /usr/local/etc/php.ini
5555
RUN cd /usr/src && curl -OL https://github.com/symfony/symfony/archive/v4.2.3.tar.gz
56-
56+
RUN adduser -u 2000 -g 2000 -h /home/trydirect -s /bin/bash -D trydirect
5757
WORKDIR '/var/www/html'
5858
RUN "ls"

symfony/.env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
###> symfony/framework-bundle ###
1717
APP_ENV=dev
1818
APP_SECRET=65912b9e9e8f74185cef1f4103dccd14
19-
LOCAL_USER=1001:1001
19+
LOCAL_USER=2000:2000
2020
##TRUSTED_PROXIES=127.0.0.1,127.0.0.2
2121
##TRUSTED_HOSTS='^localhost|example\.com$'
2222
####< symfony/framework-bundle ###

0 commit comments

Comments
 (0)