Giter Club home page Giter Club logo

one-click-deploy's Introduction

Vendure One-Click Deploy

This is a repo which can be used by "one click deploy" features of cloud hosts in order to rapidly set up a Vendure instance that is populated with test data.


This project was generated with @vendure/create.

Useful links:

Directory structure

  • /src contains the source code of your Vendure server. All your custom code and plugins should reside here.
  • /static contains static (non-code) files such as assets (e.g. uploaded images) and email templates.

Development

yarn dev

will start the Vendure server and worker processes from the src directory.

Build

yarn build

will compile the TypeScript sources into the /dist directory.

Production

For production, there are many possibilities which depend on your operational requirements as well as your production hosting environment.

Running directly

You can run the built files directly with the start script:

yarn start

You could also consider using a process manager like pm2 to run and manage the server & worker processes.

Using Docker

We've included a sample Dockerfile which you can build with the following command:

docker build -t vendure .

and then run it with:

# Run the server
docker run -dp 3000:3000 -e "DB_HOST=host.docker.internal" --name vendure-server vendure npm run start:server

# Run the worker
docker run -dp 3000:3000 -e "DB_HOST=host.docker.internal" --name vendure-worker vendure npm run start:worker

Docker compose

We've included a sample docker-compose.yml file which demonstrates how the server, worker, and database may be orchestrated with Docker Compose.

Plugins

In Vendure, your custom functionality will live in plugins. These should be located in the ./src/plugins directory.

Migrations

Migrations allow safe updates to the database schema. Migrations will be required whenever you make changes to the customFields config or define new entities in a plugin.

The following npm scripts can be used to generate migrations:

yarn migration:generate [name]

The generated migration file will be found in the ./src/migrations/ directory, and should be committed to source control. Next time you start the server, and outstanding migrations found in that directory will be run by the runMigrations() function in the index.ts file.

If, during initial development, you do not wish to manually generate a migration on each change to customFields etc, you can set dbConnectionOptions.synchronize to true. This will cause the database schema to get automatically updated on each start, removing the need for migration files. Note that this is not recommended once you have production data that you cannot lose.


You can also run any pending migrations manually, without starting the server by running:

yarn migration:run

You can revert the most recently-applied migration with:

yarn migration:revert

one-click-deploy's People

Contributors

northflank-cloud-build-run[bot] avatar seminarian avatar michaelbromley 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.