Code Monkey home page Code Monkey logo

nodedock's Introduction

Nodedock Build status

Nodedock is a community-driven project to create the best Docker Node development environment.

Node + Docker

Goal

I'm an ex-PHP developer, and I've used to use Laradock and similar solutions a lot. However, there's no close thing in NodeJS ecosystem (or at least I didn't find it). So, I decided to build a solution based on Laradock, but for NodeJS. This is how Nodedock was born.

Check it out on example project

Just hit in a terminal:

cp env-example .env
APP_CODE_PATH_HOST=./examples/simple/ docker-compose up -d node nginx

Open http://127.0.0.1/ to get a greeting from an example project :)

You can check the logs using ./logs.sh command to see what's going on during the project startup.

See other examples here

Quick Start

You need to have a node project with package.json with start script definition as node container will run npm start command after start up.

cd $NODE_PROJECT_ROOT
git submodule add https://github.com/nodedock/nodedock.git
cp nodedock/env-example nodedock/.env
cd nodedock/
docker-compose up -d nginx node workspace
docker-compose logs -f

The last one is optional.

Alternative Commands

You can also declare the list of services you'd like to run using NODEDOCK_SERVICES variable in .env (you can create your own .env by copying env-example file).

After that, you'll be able to use start.sh, stop.sh, restart.sh and logs.sh scripts which are located in the root directory of nodedock.

Documentation

Available on project's website nodedock.io

Working with Documentation

You'll need Docsify:

yarn global add docsify-cli

After that, you can view docs by running docsify serve ./docs and visiting http://localhost:3000

Based on Laradock

This project is based on awesome Laradock (contributors)

LICENSE

MIT

nodedock's People

Contributors

arifmahmudrana avatar dependabot[bot] avatar mixalistzikas avatar newjett0617 avatar shahi-d avatar shov avatar sudoist avatar viatsko avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nodedock's Issues

cannot update WORKSPACE_TIMEZONE

Issue:

I found issues on workspace image, i try to change WORKSPACE_TIMEZONE from UTC to Asia/Kuala_Lumpur, but rebuild the image and check on workspace bash the TIMEZONE still UTC.

I run docker-compose up --build workspace
but the TIMEZONE still UTC

any idea to update it ?


NodeJS 9000 not working, trying to fix it

Info:

  • Docker version ($ docker --version): 2.0.0.0-mac81 (29211)
  • Nodedock commit ($ git rev-parse HEAD): master
  • System info (Mac, PC, Linux): Macbook 10.14.3
  • System info disto/version: 12" 2017

Issue:

cp env-exmaple .env
docker-compose up -d nginx mysql 

after that, can't use 9000 port to access nodejs service

I added

ports:
        - "9000:9000"
        - "9229:9229"

to docker-compose.yml NodeJs Section
then work

Yarn not working through "exec workspace yarn" command

Info:

  • Docker version ($ docker --version): 18.09.0, build 4d60db4
  • Nodedock commit ($ git rev-parse HEAD): f830d8f
  • System info (Mac, PC, Linux): Mac
  • System info disto/version: 10.14.1

Issue:

After running docker-compose exec workspace yarn it throws
OCI runtime exec failed: exec failed: container_linux.go:348: starting container process caused "exec: \"yarn\": executable file not found in $PATH": unknown


Expected behavior:

Yarn should work.


Reproduce:

Just install the project and run via ./start.sh


cannot build workspace

Info:

  • Docker version ($ docker --version):
  • Nodedock commit ($ git rev-parse HEAD):
  • System info (Mac, PC, Linux):
  • System info disto/version:

Docker version 20.10.8, build 3967b7d

Issue:


Expected behavior:


Reproduce:


cannot build workspace

Relevant Code:

Building workspace
[+] Building 1.1s (3/3) FINISHED                                                                                                                                                                                                                                                                                                                                               
 => [internal] load build definition from Dockerfile                                                                                                                                                                                                                                                                                                                      0.0s
 => => transferring dockerfile: 84B                                                                                                                                                                                                                                                                                                                                       0.0s
 => [internal] load .dockerignore                                                                                                                                                                                                                                                                                                                                         0.0s
 => => transferring context: 2B                                                                                                                                                                                                                                                                                                                                           0.0s
 => ERROR [internal] load metadata for docker.io/phusion/baseimage:latest                                                                                                                                                                                                                                                                                                 1.0s
------
 > [internal] load metadata for docker.io/phusion/baseimage:latest:
------
failed to solve with frontend dockerfile.v0: failed to create LLB definition: docker.io/phusion/baseimage:latest: not found

Starting caddy container error.

Info:

  • Docker version ($ docker --version): Docker version 19.03.8, build afacb8b7f0
  • Nodedock commit ($ git rev-parse HEAD): master
  • System info (Mac, PC, Linux): Linux
  • System info disto/version: MX Linux MX-19.1

Issue:

image

Error when starting caddy container


Expected behavior:

Caddy should start without problems.


Reproduce:

From a new clone after copying env and stuff, run the start caddy command:

docker-compose up caddy


Relevant Code:

Created PR: 9865d87

Cannot Connect to database

Hello i have succesfully install nodedock in my aws server and it is working great. When i am trying to connect to the database i just cannot connect

My .env in nodejs is the following

DB_HOST=nodedock_mysql_1
DB_PORT=3306
DB_USER=default
DB_PASS=secret
DB_NAME=default

The docker ps gives me the following result

nodedock_nginx_1
nodedock_node_1
nodedock_phpmyadmin_1
nodedock_docker-in-docker_1
nodedock_mysql_1
nodedock_workspace_1

I can succesfully log in to phpmyadmin with server: nodedock_mysql_1 default and secret

But in the node app it just doesnt connect!

Nodedock multiple projects

Any idea for multiple project inside a nodedock.

  • Nodedock
  • Project 1
  • Project 2

Can i run both projects on nodedock as laradock did?

[SOLVED] failed connect to mongodb when i ./start.sh & run node index in workspace bash

Info:

  • Docker version ($ docker --version): 19.03.4
  • Nodedock commit ($ git rev-parse HEAD): 5b1d93b
  • System info (Mac, PC, Linux): Linux
  • System info disto/version: Xubuntu 18.04 LTS

Issue:

i have a problem when i run ./start.sh, the logs show "failed to connect to server [localhost:27017] on first connect [MongoNetworkError: connect ECONNREFUSED 127.0.0.1:27017]". this is the same issue when I use workspace bash run "node index.js". I check the MongoDB is UP. btw this is my NODEDOCK_SERVICES=nginx mongo node workspace.

but no issue when i run "node index.js or nodemon index.js" in my nodejs project root...
any solution for my issue?


error response:

node_1                | 2019-11-03T05:00:43.606643127Z Not Connected to Database ERROR!  { error:
node_1                | 2019-11-03T05:00:43.606681800Z    { MongoNetworkError: failed to connect to server [localhost:27017] on first connect [MongoNetworkError: connect ECONNREFUSED 127.0.0.1:27017]
node_1                | 2019-11-03T05:00:43.606690297Z        at Pool.<anonymous> (/var/www/node_modules/mongodb-core/lib/topologies/server.js:431:11)
node_1                | 2019-11-03T05:00:43.606696439Z        at Pool.emit (events.js:198:13)
node_1                | 2019-11-03T05:00:43.606720078Z        at connect (/var/www/node_modules/mongodb-core/lib/connection/pool.js:557:14)
node_1                | 2019-11-03T05:00:43.606725330Z        at makeConnection (/var/www/node_modules/mongodb-core/lib/connection/connect.js:39:11)
node_1                | 2019-11-03T05:00:43.606730608Z        at callback (/var/www/node_modules/mongodb-core/lib/connection/connect.js:261:5)
node_1                | 2019-11-03T05:00:43.606737714Z        at Socket.err (/var/www/node_modules/mongodb-core/lib/connection/connect.js:286:7)
node_1                | 2019-11-03T05:00:43.606744977Z        at Object.onceWrapper (events.js:286:20)
node_1                | 2019-11-03T05:00:43.606751825Z        at Socket.emit (events.js:198:13)
node_1                | 2019-11-03T05:00:43.606757834Z        at emitErrorNT (internal/streams/destroy.js:91:8)
node_1                | 2019-11-03T05:00:43.606764686Z        at emitErrorAndCloseNT (internal/streams/destroy.js:59:3)
node_1                | 2019-11-03T05:00:43.606771119Z        at process._tickCallback (internal/process/next_tick.js:63:19)
node_1                | 2019-11-03T05:00:43.606777413Z      name: 'MongoNetworkError',
node_1                | 2019-11-03T05:00:43.606783650Z      errorLabels: [ 'TransientTransactionError' ],
node_1                | 2019-11-03T05:00:43.606790086Z      [Symbol(mongoErrorContextSymbol)]: {} } }

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.