Skip to content

A demo project about how to deploy a FrankenPHP based Symfony app on Clever Cloud

Notifications You must be signed in to change notification settings

davlgd/frankenphp-symfony-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 

Repository files navigation

Serve a Symfony app with FrankenPHP on Clever Cloud

This is a simple demo of how to deploy a Symfony application served by FrankenPHP in a Docker container on Clever Cloud. You'll need a Clever Cloud account and Clever Tools.

Setup Clever Tools

npm i -g clever-tools
clever login

Create the local application

To create the Symfony application, you'll need the CLI, then:

symfony new FrankenSymfony --demo 
cd FrankenSymfony

Create and configure the Clever Cloud application

We set the port (8080) of FrankenPHP via SERVER_NAME:

clever create -t docker 
clever env set SERVER_NAME ":8080"

Create the Dockerfile

We need to install the intl extension for the Symfony demo application:

cat << 'EOF' > Dockerfile
FROM dunglas/frankenphp

COPY . /opt/app/

WORKDIR /opt/app/

# Install dependencies
RUN apt-get update && \
    apt-get install -y git zip && \
    install-php-extensions intl

# Install composer
RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" && \
    php composer-setup.php && \
    php -r "unlink('composer-setup.php');" && \
    php composer.phar install
EOF

You can also choose to download the Dockerfile from this repository:

wget -q https://raw.githubusercontent.com/davlgd/frankenphp-symfony-demo/main/Dockerfile

Git push!

git add . && git commit -m "Initial commit"
clever deploy
clever open

After the deployment, you should see the Symfony application running on Clever Cloud.

About

A demo project about how to deploy a FrankenPHP based Symfony app on Clever Cloud

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published