GithubHelp home page GithubHelp logo

lequanghuylc / c9sdk-pm2-nginx Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 33 KB

Single Dockerfile that runs c9sdk pm2 via nginx reserve proxy

Dockerfile 35.51% Shell 60.18% JavaScript 2.28% TypeScript 2.03%

c9sdk-pm2-nginx's Introduction

Intro

This Docker container is a IDE / Code editor, built from C9 SDK. With C9 IDE you can set up development environments in the cloud. It comes with nvm, pm2 and nginx that can help you publish your application pulically accessible to the world.

Deploy on Railway

Variable

  • C9SDK_PASSWORD: password for basic auth. it would be publically accessible if this env is not defined
  • GIT_REPO: automatic git repo deployment
  • GIT_BRANCH: target branch, if not present, default branch will be used.
  • INITIAL_COMMAND: custom command that can be used for installing custom dependencies or even start your git repo your own way

What is the best use case for this?

  • Online - cross device development. it is an alternative to code-server. it is lighter than code-server which will be more resouce (cost) effective.
  • Run any real world application without Docker (DinD is not yet supported in Railway)
  • Gitlab Runner Shell executor for Gitlab CI/CD

Instructions to run real world application

  • Run your application at some local port. for example: python -m SimpleHTTPServer 9000 to start a static web server at port 9000.
  • Prepare your domain and add to Service settings -> networking. make sure the DNS record is setup.
  • Add a nginx conf files to /etc/nginx/sites-enabled to reserve proxy your application. make sure to use server_name your_domain;
  • Run nginx -t to test your .conf file
  • Run nginx -s reload to apply changes.
  • Your application should be pulically accessible now.

Auto Git Repo Deployment

  • The start script checks the environment variable GIT_REPO (and GIT_BRANCH) and automatically clones and deploys the repository.
  • GIT_REPO should be https url containing access token key
  • The repo will be cloned to /root/the-project.
  • The repo needs to have the following deployment structure, which is:
    • depoyments: folder
      • deploy.sh: suppose to install project deps and start the project
      • setup-cron.sh suppose to setup cron for automatically checking new commit and pull and re-deploy
      • setup-nginx.sh suppose to setup nginx reserve proxy with production domain name

c9sdk-pm2-nginx's People

Contributors

lequanghuylc avatar

Watchers

 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.