Giter Site home page Giter Site logo

webapp-devops's Introduction

DevOps Mock Web Application

This is a web application created for our DevOps workshop. Its primary purpose is to demonstrate server automation.

How to Run the Application as a Node.js App

  1. Clone the repository and navigate to its directory:

    $ git clone https://github.com/ilmossp/webapp-devops
    $ cd webapp-devops
  2. Create a .env file:

    $ touch .env
  3. Add the database connection URL to the .env file. Depending on your database choice, use one of the following examples:

    • For SQLite:

      # SQLite
      DB_CONNECTION_STRING="sqlite:/path/to/file.db"
    • For PostgreSQL:

      # PostgreSQL
      DB_CONNECTION_STRING="postgres://user:[email protected]:5432/dbname"
  4. Install the required dependencies:

    npm install
  5. Start the application:

    node app.js
  6. The application should now be listening on port 3000.

  7. On your first run, make sure to send a request to the API route /sync in order to create the necessary database tables.

How to Run the Application from a Docker Image

Assuming you have cloned the project and are running it from the project directory:

  1. Build the Docker image:

    docker build -t webapp .
  2. Run the Docker container, mapping port 4000 on your host machine to port 3000 in the container, and provide the DB_CONNECTION_STRING as an environment variable (replace YOURCONNECTIONSTRING with your actual database connection string):

    docker run -p 4000:3000 -e DB_CONNECTION_STRING=YOURCONNECTIONSTRING webapp

webapp-devops's People

Contributors

ilmossp 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.