Giter VIP home page Giter VIP logo

flexhub's Introduction

Flexhub App build

Flexhub is a private repository of Symfony Flex recipes available for deployment on your infrastructure. Compatible with Flex serverless.

Deployment

Flexhub is distributed as a Docker image, which makes it easy to deploy.

docker pull sonnymilton/flexhub:latest

Important details:

  • The application requires PostgreSQL and Redis to run.
  • You must set environment variables:
    • DATABASE_URL - PostgreSQL database DSN.
      Example: postgresql://user:password@localhost:5432/flex_server?serverVersion=16&charset=utf8
    • REDIS_URL - Redis server DSN.
      Example: redis://localhost:6379
  • Inside the container, the application runs on port 80
docker-compose.yml example
services:
    flexhub:
        image: sonnymilton/flexhub:0.1.0
        tty: true
        environment:
            REDIS_URL: redis://redis:6379
            DATABASE_URL: postgresql://postgres:postgres@postgres:5432/flex_server?serverVersion=16&charset=utf8
        ports:
            - "8080:80"
        depends_on:
            - postgres
            - redis

    redis:
        image: eqalpha/keydb:alpine_x86_64_v6.3.4

    postgres:
        image: postgres:16.2-alpine
        environment:
            POSTGRES_DB: flex_server
            POSTGRES_USER: postgres
            POSTGRES_PASSWORD: postgres
Kubernetes manifest example
apiVersion: v1
kind: Pod
metadata:
    name: flexhub-demo
spec:
    containers:
        - name: flexhub
          image: sonnymilton/flexhub:latest
          ports:
              - containerPort: 80
          env:
              - name: REDIS_URL
                value: "redis://localhost:6379"
              - name: DATABASE_URL
                value: "postgresql://user:password@localhost:5432/flex_server?serverVersion=16&charset=utf8"

        - name: redis
          image: redis:latest
          ports:
              - containerPort: 6379

        - name: postgres
          image: postgres:16.2
          ports:
              - containerPort: 5432
          env:
              - name: POSTGRES_USER
                value: "user"
              - name: POSTGRES_PASSWORD
                value: "password"
              - name: POSTGRES_DB
                value: "flex_server"

Configure your composer.json to use your private flex server

"extra": {
    "symfony": {
        "endpoint": [
            "https://flexhub.yourhost.lan/api/flex/index.json",
            "flex://defaults"
        ]
    }
}
  • Replace https://flexhub.yourhost.lan with the host on which your flex recipes server is deployed.
  • The extra.symfony key will most probably already exist in composer.json. In that case, add the "endpoint" key to the existing extra.symfony entry.

Development

Local deployment

docker-compose up -d.
The application runs on port 8000.

Running code quality tools locally

Use composer cq to run PHPstan + php-cs-fixer + phpunit

Made with

php logo symfony logo doctrine logo composer logo typescript logo vuejs logo bootstrap logo npm logo postgresql logo redis logo nginx logo docker logo

โœ… No outdated dependencies

flexhub's People

Contributors

sonnymilton avatar kl3sk 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.