Code Monkey home page Code Monkey logo

docker-compose-starter's Introduction

Docker-compose Starter

Auxilin.com โ€” Production ready Node, React starter kit for building products at a warp speed

All Contributors license PRs Welcome

Watch on GitHub Star on GitHub Follow Tweet @auxilin

Run your development environment with a single command using docker-compose ๐Ÿš€. This repository was boarn with aim to share how simple development environment could be with docker-compose. If you ever had to perform 100 steps to run a new project you will like this a lot. You could read more on the problem in this blog post.

Features

  • ๐Ÿ”ฅ Simple project start run your development evnrionment with a single command
  • ๐Ÿ™€ Environment agnostic with docker-compose you can run your project on Mac, Windows or Linux environments without any issues.
  • ๏ธโšก๏ธ Multi-language projects choose whatever language you need to solve the problem, but keep development environment easy for developers.

Getting Started

./bin/start.sh โ€” starts entire application ./bin/run-tests.sh โ€” runs tests using docker-compose

The repository consists 4 demo-purpose independent services:

  1. Landing - a landing site
  2. Web - a simple frontend that serves client side assets for React application and do some server side rendering.
  3. Api - a restful api.
  4. Admin - an admin site

For learning purpose just pay attention to the following files:

  1. Dockerfile
  2. Dockerfile.dev
  3. package.json
  4. docker-compose.yml
  5. docker-compose.local-tests.yml
  6. .env

Separate Dockerfile for development

Dockerfile.dev used to run every project on local environment. There are two reasons for using separate dockerfile for local environments:

  1. To run application using Nodemon, which automatically restart application on code change. (same can be achieved by overriding command in docker-compose.yml)
  2. Production Docker files has npm run build && npm prune --production. That needed to keep your Docker images smaller, by removing devDependencies after build step has been completed. In this step you would typically use Webpack, Gulp or any other bundlers / task runners.

If image size is not an issue - I would recommend to keep same Dockerfile for both development and production environments. You might also want to look into this discussion

Change Log

This project adheres to Semantic Versioning. Every release is documented on the Github Releases page.

License

Docker-compose Starter is released under the MIT License.

Contributing

Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.

Contributors

Thanks goes to these wonderful people (emoji key):


Andrew Orsich

๐Ÿ’ฌ ๐Ÿ“ ๐Ÿ’ป ๐Ÿค”

This project follows the all-contributors specification. Contributions of any kind welcome!

docker-compose-starter's People

Contributors

anorsich avatar ezhivitsa avatar maqpie 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

docker-compose-starter's Issues

No docker-compose for production?

You provided docker-compose.yml in the root that builds the Dockerfile.dev images. Do you not have a compose file that builds the Dockerfile images for production or am I missing something here?

Also, the link to the blog post in the README is missing, it only has https://.

Debugging and autocompletion in IDE

Great article, thanks.

I've been playing with docker-compose for dev a few months back, but still wasn't satisfied as far as debugging and autocompletion.

Since you run everything in docker, you inject your source code into container, but node_modules are not available in IDE for autocompletion.
Another problem is debugging.

Do you handle it somehow?

--
Thanks,
Alex

How do you handle code sharing between different services in the same monorepo?

It doesn't come up in this sample repo, but I'm assuming that in a large enough project you would have several top-level "common" directories, meant to be shared between two or more services.

With every service having its own Dockerfile under its sub-dir, it wouldn't be possible to include also the required common dirs straight from the repo, since Docker doesn't allow referencing the filesystem from outside the "build context" (e.g. ../common).

Do you have an elegant solution for this use-case?

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.