Giter Site home page Giter Site logo

froldev / symfony-website-docker Goto Github PK

View Code? Open in Web Editor NEW

This project forked from arkanii/symfony-website-docker

0.0 0.0 0.0 54 KB

Create your Symfony website project (Or use a existing one !) with Caddy, PHP-FPM, MariaDB and phpMyAdmin with only one command with docker-compose ! :tada: :man_technologist: :woman_technologist:

License: MIT License

Shell 46.72% Dockerfile 53.28%

symfony-website-docker's Introduction

I created another project with all knowledge I learned on working on this project. I will focus on this one so I set this repository read-only.

Symfony Website Docker

I learned Docker with this project, and I try to implement my own logic into this one.

All your Symfony development environment in HTTPS with only 1 command ! 😎 🀯

Getting Started

  1. If not already done, install Docker Compose
  2. Copy .env.sample to .env and complete the information
  3. Run ./run.sh -d (or ./run.sh to see all logs), it will create the Symfony website skeleton automatically for you (it can take 1 or 2 minutes)
  4. Open https://localhost in your favorite web browser and accept the auto-generated TLS certificate
  5. Let's code your Symfony website ! πŸŽ‰ πŸ‘¨β€πŸ’» πŸ‘©β€πŸ’»
  6. Open https://localhost:8888 to access to your phpMyAdmin

(All those localhost links are valid if you let the .env by default.)

Whats's inside ? 🧐

  • Caddy
  • PHP-FPM
  • MariaDB
  • phpMyAdmin

Variables available

Database & phpMyAdmin

  • MARIADB_VERSION : Version of MariaDB. (Default: 10)
  • MYSQL_DATABASE : Name of the database. (Default: symfony)
  • MYSQL_ROOT_PASSWORD : Root's password. Please use a strong password. (Default: symfony)
  • MYSQL_USER : Name of the user. (Default: symfony)
  • MYSQL_PASSWORD : User's password. Please use a strong password. (Default: symfony)
  • PORT_PHPMYADMIN : Port used for browser (https://localhost:8888 for example). (Default: 8888)

PHP & Symfony

  • PHP_VERSION : PHP version. (Default: 8)
  • SYMFONY_VERSION : Version of Symfony.
  • PORT_SYMFONY : Port used for browser (https://localhost:443 for example). (Default: 443)

GIT (If you want to use an existing Symfony project)

  • CUSTOM_REPOSITORY : Link of your git repository ([email protected]:Arkanii/symfony-website-docker.git or https://github.com/Arkanii/symfony-website-docker.git for example).
  • CUSTOM_REPOSITORY_WITH_GIT_DIR : If set to 1, this will replace the .git directory of the template by the .git directory located into the project located in the CUSTOM_REPOSITORY variable. (Default: 0)
  • SSH_KEY_PATH : Path of your SSH key.

Others

  • TIMEZONE : Timezone to set the correct time on the containers.

Q&A

Why use a run.sh into this template ?

Symfony uses the .env file. Into their best practices, Symfony asks to use environment variables for obvious security reasons so as not to commit environment variables or passwords.

However, Docker uses the .env file too, witch needs this file to get these secrets variables which are stored in .env.local file. That's why I created a run.sh in order to grab this information and run them into Symfony and Docker at the same time.

This script is also used to avoid permissions issues between files that are on your computer, and those that are in the Docker service.

If anyone has a better idea to avoid this file, don't hesitate to open a ticket !

Can I use Symfony CLI into my project when docker-compose is lunched ?

Of course, you can ! Just lunch symfony serve after ./run.sh -d and open https://127.0.0.1:8000. (by default)

If you decide to not use Symfony CLI, you need to explain the exact version of MariaDB you used in the MARIADB_VERSION variable.

My web browser block my custom port !

Check these links and look if your custom port is not reserved by your web browser.

  • Restricted ports from Chrome : here
  • Restricted ports from Mozilla : here

Credits

Created by ThΓ©o Frison, inspired and taken for some parts from this project.

symfony-website-docker's People

Contributors

arkanii avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.