GithubHelp home page GithubHelp logo

prestashop-12-factor's Introduction

Twelve-Factor Prestashop

Prestashop, the Twelve-Factor way: fully managed using Composer and configured using environment variables. This has been heavily inspired by Wordpress 12 Factor

Code Climate StyleCI Codacy Badge Prestashop 1.7.1 Patreon

General Concepts and Considerations

The Prestashop installation is fully contained in a shop1 subfolder upon Heroku deployment. A settings.inc.php resides in the root of the project, and uses several different environment variables to control behavior.

The configuration file is kept as generic as possible; on Heroku, add-ons JawsDB (for MySQL) and SendGrid (for E-Mails) are used.

The assumption is that this installation runs behind a load balancer whose X-Forwarded-Proto header value can be trusted; it is used to determine whether the request protocol is HTTPS or not.

Quick Deploy

If you have a Heroku account, you may simply use the following button to deploy this application:

Deploy

After the deploy, in Heroku's Dashboard under "Settings" for your deployed application, remove the PRESTASHOP_ADMIN_* environment variables.

Manual Deploy

Clone

Clone this repo:

$ git clone https://github.com/absalomedia/prestashop-12-factor
$ cd prestashop-12-factor

If you like, you can locally install dependencies with Composer:

$ composer install

Create Application and Add-Ons

Create a new app and add add-ons for MySQL and E-Mail:

$ heroku create
$ heroku addons:create jawsdb
$ heroku addons:create sendgrid

Deploy

$ git push heroku master

Finalize Installation

This will create tables and set up an admin user:

$ heroku run 'composer prestashop-db-core --name='Prestashop on Heroku' --domain=example.herokuapp.com --db_server=localhost --db_name=prestashop --db_user=admin --db_password=admin [email protected] '

Visit ecommerce store

Navigate to the application's URL, or open your browser the lazy way:

$ heroku open

Updating Prestashop and Plugins

To update all dependencies:

$ composer update

Environment Variables

settings.inc.php will use the following environment variables (if multiple are listed, in order of precedence):

Database Connection

DATABASE_URL or JAWSDB_URL or CLEARDB_DATABASE_URL (format mysql://user:pass@host:port/dbname) for database connections.

SendGrid

SENDGRID_USERNAME and SENDGRID_PASSWORD for SendGrid credentials.

prestashop-12-factor's People

Contributors

absalomedia avatar krzysiekpiasecki avatar

Watchers

James Cloos 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.