Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Jan 18, 2025. It is now read-only.

A starter code for Nodejs, GraphQL, Docker and more

NotificationsYou must be signed in to change notification settings

iamgrewal7/Node.js-GraphQL-Docker-NGINX-Template

Repository files navigation

The project is build using docker, with different configuration for development and production and environment. Language used is TypeScipt (config and lint file is include). I am usingGraphQL-yoga which is build on top ofApollo,Express server.Redis is used along withexpress-session for maintain session. Project also consist ofwinston logger which logs all the errors to error.log file andSentry library if you wish to track errors on sentryFor persistance, I useMySQL along withPrisma ORM which can automatically apply migrations and has nice Django-Admin like UI for adding and dropping data.

How to get started

Development

  1. Install Docker Cli and Docker Compose
  2. Clone the repo and create a.env file with following info
    • SECRET_KEY(Used by Redis)
    • NODE_ENV
    • HOST
    • PORT
    • SESSION_NAME
  3. docker-compose -f "docker-compose.dev.yml" -f "docker-compose.yml" up -d --build
  4. This will build images for Node, MySQL, Redis and Express Server and will run those images in seperate containers.
  5. Open shell for MySQL container usingdocker exec -it {continer_id or name} /bin/sh -c "[ -e /bin/bash ] && /bin/bash || /bin/sh" and create database.
  6. "docker-compose.dev.yml" run the express server usingnodemon and mounts the local volume, therfore any edit made in project folder, will triggernodemon to rebuild the server and therefore enabling development while in docker.

Production

  1. For deploying the project usedocker-compose.prod.yml file instead of"docker-compose.dev.yml". It creates and run image of NGINX(used as reverse proxy) and Certbot(used for ssl certificate for domains)
  2. You will still need to create databse inside docker, when running this for first time.

WIP

About

A starter code for Nodejs, GraphQL, Docker and more

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp