Skip to content
Snippets Groups Projects
Commit 4edffd33 authored by PEREZ-RAMIREZ Julian's avatar PEREZ-RAMIREZ Julian
Browse files

symfony app working with ngnix

parent 4e6328f5
Branches
No related tags found
No related merge requests found
server {
listen 80;
server_name localhost;
root /var/www/public;
index index.php index.html;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location ~ \.php(/|$) {
fastcgi_pass app:9000;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
error_log /var/log/nginx/error.log;
access_log /var/log/nginx/access.log;
}
\ No newline at end of file
services:
symfony:
image: bitnami/symfony
container_name: symfony_app
web:
image: nginx:alpine
container_name: nginx_server
working_dir: /var/www
ports:
- "80:8000"
environment:
- SYMFONY_PROJECT_SKELETON=symfony/skeleton
- DATABASE_HOST=mysql
- SYMFONY_DATABASE_PASSWORD=symfony
- "8080:80"
volumes:
- ./web_app:/app
- ./web_app:/var/www
- ./.docker/nginx/default.conf:/etc/nginx/conf.d/default.conf
depends_on:
- mysql
- app
mysql:
image: mysql:8.1
app:
image: php:8.2-fpm
container_name: symfony_app
working_dir: /var/www
volumes:
- ./web_app:/var/www
environment:
- APP_ENV=dev
depends_on:
- db
db:
image: mysql:9.2.0
container_name: symfony_db
environment:
MYSQL_ROOT_PASSWORD: password
MYSQL_DATABASE: wishlist_db
MYSQL_USER: symfony
MYSQL_PASSWORD: symfony
MYSQL_ROOT_PASSWORD: password
MYSQL_USER: admin
MYSQL_PASSWORD: admin_password
ports:
- "3306:3306"
volumes:
- ./mysql_data:/var/lib/mysql
phpmyadmin:
image: phpmyadmin/phpmyadmin
container_name: phpmyadmin
phpMyAdmin:
image: phpmyadmin:5.2.2-apache
container_name: phpMyAdmin
ports:
- "8080:80" #this line maps your pc port to the container port
depends_on:
- mysql #this line links this container to the db container
- "8081:80"
environment:
PMA_HOST: mysql
#If you got an error about folder permissions with innodb_redo,
# try to fix it by running sudo chmod -R 755 ~/<your_path>/wishlist/mysql_data
\ No newline at end of file
- MYSQL_ROOT_PASSWORD=password
- MYSQL_USER=admin
- MYSQL_PASSWORD=admin_password
\ No newline at end of file
{
"require": {
"symfony/orm-pack": "^2.4"
},
"require-dev": {
"symfony/maker-bundle": "^1.62"
}
}
File moved
services:
###> doctrine/doctrine-bundle ###
database:
ports:
- "5432"
###< doctrine/doctrine-bundle ###
services:
###> doctrine/doctrine-bundle ###
database:
image: postgres:${POSTGRES_VERSION:-16}-alpine
environment:
POSTGRES_DB: ${POSTGRES_DB:-app}
# You should definitely change the password in production
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-!ChangeMe!}
POSTGRES_USER: ${POSTGRES_USER:-app}
healthcheck:
test: ["CMD", "pg_isready", "-d", "${POSTGRES_DB:-app}", "-U", "${POSTGRES_USER:-app}"]
timeout: 5s
retries: 5
start_period: 60s
volumes:
- database_data:/var/lib/postgresql/data:rw
# You may use a bind-mounted host directory instead, so that it is harder to accidentally remove the volume and lose all your data!
# - ./docker/db/data:/var/lib/postgresql/data:rw
###< doctrine/doctrine-bundle ###
volumes:
###> doctrine/doctrine-bundle ###
database_data:
###< doctrine/doctrine-bundle ###
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>WishList</title>
</head>
<body>
<p> WishList is running ! </p>
</body>
</html>
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment