How to create an automated deploy pipeline with Symfony 5 and DigitalOcean App Platform

Why Symfony?

Why DigitalOcean App Platform?

Requirements

Creating a new Symfony 5 Project

Create a test Application

config/routes.yml--------------------------------------------------------#index:#    path: /#    controller: App\Controller\DefaultController::index
scr/controller/DefaultController.php-----------------------------------------------------------<?phpnamespace App\Controller;
use \Symfony\Component\HttpFoundation\Response;
use \Symfony\Component\Routing\Annotation\Route;
use \Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
class DefaultController extends AbstractController
{
/**
* @Route("/", name="app_index")
*/
public function index()
{
return $this->render('base.html.twig', []);
}
/**
* @Route("/login", name="app_login")
*/
public function show()
{
return new JsonResponse([
"status" => "ok",
"slug" => "login",
]);

}
}
templates/base.html.twig------------------------------------------------------<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>{% block title %}Welcome!{% endblock %}</title>
{# Run `composer require symfony/webpack-encore-bundle`
and uncomment the following Encore helpers to start using Symfony UX #}
{% block stylesheets %}
{#{{ encore_entry_link_tags('app') }}#}
{% endblock %}
{% block javascripts %}
{#{{ encore_entry_script_tags('app') }}#}
{% endblock %}
</head>
<body>
{% block body %}
<a href="{{ path('app_login') }}">this link for login</a>
{% endblock %}
</body>
</html>

Deploying on DigitalOcean App Platform

Activate Apache Rewrite Engine on App Platform

--

--

--

Software developer at Fluentify LTD. AWS, Docker and programming enthusiast.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

{UPDATE} Shadeless - Endless Color Shades Puzzle Game! Hack Free Resources Generator

How to build a test API using Flask, 1 file, 4 steps, any environment!

Localizing macOS applications.

Aragon: More speakers confirmed for AraCon2019, next vote for AGP-1 is January 17th 2019, new…

DevLog #21: Multiplayer Driving, Track Design, and Builder Modules

Remember the ignorance

Images post meta fields

7 STEPS TO MAKE A FLAWLESS TECHNICAL REQUIREMENTS DOCUMENT

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
mattia toselli

mattia toselli

Software developer at Fluentify LTD. AWS, Docker and programming enthusiast.

More from Medium

“connection closed by remote host” When Fetching Go/PHP Private Dependencies via SSH

Docker with PHP 8.1, NGINX and MySQL

Real-Time Twitter Bot that responds with James Webb’s telescope telemetry

Curved rocket trail on dusk sky, starting on earth and ending in cloudless sky

Using Minio to work with S3 buckets locally

Using Minio to work with S3 buckets locally