Answer the question
In order to leave comments, you need to log in
Why can't I run the application through docker?
Hello! I'm trying to run a symfony application using docker. I downloaded the symfony application using composer'a api
composer create-project symfony/skeleton my_project_name
. Created in the installed project Dockerfile. Filled it with content like thisFROM php:7.4-cli
ADD . /opt/symfony
WORKDIR /opt/symfony
EXPOSE 8080
CMD ["php", "-S", "localhost:8080", "-t", "public/"]
php -S localhost:8080 -t public/
start the server with the command. sudo docker build -t name/symfony .
sudo docker run -p 8080:8080 name/symfony
Answer the question
In order to leave comments, you need to log in
And will you also run it in production on the server built into the php?
Since you are already using docker, use the php-fpm 7.4 application server, and nginx 1.19 as the web server. (Well, or try to reproduce the combination on which the application will work in production)
There will be fewer surprises later, because you will learn about them in the development process.
For docker-compose, the config will look something like this:
version: '2'
services:
nginx:
image: nginx:1.19
ports:
- "80:80"
volumes:
- ./path_to_nginx_config:/etc/nginx/conf.d
- ./path_to_app:/var/www/app
links:
- php
php:
image: php:7.4-fpm
ports:
- "9000:9000"
volumes:
- ./path_to_app:/var/www/app
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question