Skip to content

Commit

Permalink
fix - some configuration issue with nginx
Browse files Browse the repository at this point in the history
  • Loading branch information
jenovateurs committed Jan 11, 2024
1 parent e7494ed commit 57ca61e
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 3 deletions.
9 changes: 6 additions & 3 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,17 @@ Each image can be built using the following command.

### Postgres

# to run the migrations when starting the database
--volume $(pwd)/migrations:/docker-entrypoint-initdb:ro \
# today, the 30th of april 2022, this is the latest release
postgres:14.2-bullseye

```bash
docker run -d \
--name eco-benchmark-database \
# to run the migrations when starting the database
--volume $(pwd)/migrations:/docker-entrypoint-initdb:ro \
--port 5432:5432 \
-p 5432:5432 \
-e POSTGRES_PASSWORD=mysecretpassword \
# today, the 30th of april 2022, this is the latest release
postgres:14.2-bullseye

export DATABASE_URL=postgresql://postgres:[email protected]:5432/postgres
Expand Down
5 changes: 5 additions & 0 deletions service/php-symfony-nginx/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ COPY docker/www.conf /usr/local/etc/php-fpm.d/www.conf
RUN rm /usr/local/etc/php-fpm.d/docker.conf /usr/local/etc/php-fpm.d/zz-docker.conf && \
mkdir -p /var/run/php && \
chown www-data:www-data /var/run/php
# Resolve trouble right
RUN touch /run/nginx.pid
RUN chown www-data:www-data /run/nginx.pid
RUN chown -R www-data:www-data /var/lib/nginx /var/log/nginx /usr/local/var/log/
# End Resolve trouble right -
COPY docker/php.ini /usr/local/etc/php/php.ini
COPY docker/default.conf /etc/nginx/sites-available/default
ENV APP_ENV prod
Expand Down
8 changes: 8 additions & 0 deletions service/php-symfony-nginx/README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,20 @@
# How to run

## Build the image
For Mac with M1, you need to add --platform linux/amd64

```bash
docker build -t benchmark-php-symfony-nginx .
```

## Run the container
### Get database IP addresses
```bash
docker inspect \
-f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' eco-benchmark-database
```

Be careful to replace the IP address of the database (172.17.0.2) with the previously obtained result.

```bash
docker run --name=benchmark-php-symfony-nginx -d -p 8080:8080 -e DATABASE_URL='postgresql://postgres:[email protected]:5432/postgres' benchmark-php-symfony-nginx
Expand Down
6 changes: 6 additions & 0 deletions service/php-symfony-nginx/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
services:
runner:
# If you have macM1
# platform: linux/amd64
image: jdrouet/eco-benchmark:runner-default
build: ../../runner
command:
Expand All @@ -15,6 +17,8 @@ services:
- service

service:
# If you have macM1
# platform: linux/amd64
image: jdrouet/eco-benchmark:service-php-symfony-default
build: .
depends_on:
Expand All @@ -25,6 +29,8 @@ services:
restart: unless-stopped

database:
# If you have macM1
# platform: linux/amd64
image: jdrouet/eco-benchmark:database-default
build: ../../migrations
environment:
Expand Down

0 comments on commit 57ca61e

Please sign in to comment.