pomdok

command module
v1.3.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 21, 2022 License: MIT Imports: 16 Imported by: 0

README ΒΆ

pomdok 🍏

Simple wrapper to Symfony Go Binary for multi-app.

This README does not aim to explain Symfony binary, if you want more details you can read the article I made to introduce it or official documentation.

Installation πŸ’Ύ

pomdok is the only thing you have to install, the symfony binary will be automatically installed if not present on your computer.

Mac

You can install this binary through Homebrew:

brew tap jolicode/pomdok git@github.com:jolicode/pomdok.git
brew install pomdok

Linux

Download last release, extract it and you'll have the binary. I suggest you to put it in /usr/local/bin/ to be easier to use but you can do whatever you want 🀷

Getting started πŸš€

First, you need a configuration file that we call pomdok.yaml in your project root as following:

pomdok:
  tld: 'test'
  projects:
    - domain: 'api.project'
      path: '/apps/api'
      port: 9990
    - domain: 'www.project'
      path: '/apps/front'
    - domain: 'admin.project'
      path: '/apps/back-office'

You'll need at least tld field and one project to have a valid configuration.

For each "project" you have, you'll need at least a domain and port fields. port field is optional and used to force a given port for your webserver.

You can add domain aliases for a project by duplicating its entry in the list and changing the domain name (path and port must remain the same), for example:

pomdok:
  tld: 'test'
  projects:
    - domain: 'api.project'
      path: '/apps/api'
      port: 9990
    - domain: 'api-private.project'
      path: '/apps/api'
      port: 9990

To init pomdok for your project run:

pomdok init

You can add --config=configuration.yaml option if your configuration file is not in current folder with default name pomdok.yaml.

Then to start your applications πŸŽ‰

pomdok start

And to stop them:

pomdok stop

To make pomdok works, we're using symfony CLI. Some setup on this side is needed:

  • You have to setup Symfony CLI proxy (you can find how on this slide or on the official documentation)
  • And to install Symfony CLI certificate authority through symfony local:server:ca:install

Troubleshooting πŸ€•

Some debug tips πŸ”§

Because this tool use symfony CLI to run your servers, here is some advices to debug when need:

  • You can check running servers on http://127.0.0.1:7080/
  • You used start command but server is still stopped in the list ? Go in the app folder then use: symfony local:server:start, you'll have full logs and order to see what's happening !

Everything working but I have untrusted https ❌

This tool does not run symfony ca:install command since it needs sudo. This install local certificate authority. Just run it and you'll have trusted https for you apps πŸ˜‰

My website isn't working 😒

When you start pomdok, and you don't have the symfony proxy already launched, you're site won't be reachable. You have to close your web browser (really quit it, not reduce it like mac usually do).

Commands πŸ› 

init

pomdok init

Will sync your project with Symfony binary configuration. This command can run anywhere inside your project tree, it will search in current directory and will goes into parent one if nothing and again and again until finding your project configuration.

start

pomdok start

Will start symfony proxy if needed and all your apps

stop

pomdok start

Will stop all your apps

check

pomdok check

Will check your OS and needed binaries:

  • OS: should be Linux or Darwin (MacOS)
  • PHP: you need local php installation
  • Symfony: and the symfony binary πŸ˜‰

install

sudo pomdok install

Will install all needed binaries :

  • PHP: from apt or brew depending on OS
  • Symfony: with wget command ⚠ This command obviously needs sudo or being logged as root.

Sponsor

JoliCode

Open Source time sponsored by JoliCode

Documentation ΒΆ

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL