Git Product home page Git Product logo

docker-example's Introduction

Experimental Project

The project goals are to create a docker container for two services: frontend and backend. Each service has a developement and production environment. The developement environment allows to quickly develop by having the container mounting volume to the developer machine but otherwise everything is in the container (running code, node_modules, etc.). The production container contains all the transpiled JavaScript from TypeScript. Hot-reload enabled for frontend (SolidJS framework, but same with React CRA) and also with the backend (NodeJS).

Documentations

Docker References

Multi-stage and target (FROM/AS)

https://www.docker.com/blog/speed-up-your-development-flow-with-these-dockerfile-best-practices/

Docker Web App with Multi-Stage

https://nickjanetakis.com/blog/best-practices-around-production-ready-web-apps-with-docker-compose https://github.com/nickjj/docker-node-example/blob/main/Dockerfile

Docker with a React Example (REACT CRA start and Nginx)

https://dev.to/karanpratapsingh/dockerize-your-react-app-4j2e https://medium.com/geekculture/dockerizing-a-react-application-with-multi-stage-docker-build-4a5c6ca68166

Docker with a Dev and Production setup

https://viralganatra.com/docker-nodejs-production-secure-best-practices/

How to debug Docker build

https://stackoverflow.com/questions/26220957/how-can-i-inspect-the-file-system-of-a-failed-docker-build

How to Debug Build

Run

 DOCKER_BUILDKIT=0 docker-compose build  

This will give some UUID for each step. Use the UUID for the step to debug with this command:

docker run -it <uuid> bash

If the build was successful, we can use the image name.

docker run -it backend:latest bash 
docker run -it frontend:latest bash 

docker-example's People

Contributors

mrdesjardins avatar

Stargazers

 avatar Kody avatar

Watchers

James Cloos avatar  avatar  avatar

Forkers

celloliu ketan828

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.