Code Monkey home page Code Monkey logo

nextjs-docker-compose's Introduction

Next.js docker-compose Boilerplate

This repository provides a quick setup for developing Next.js applications using Docker with docker-compose. It's designed to facilitate VS Code container development without cluttering your host machine with Node.js modules, the Node runtime, npm, or other dependencies. Using Docker volumes for node_modules and VS Code container dev dependencies allows for faster build times, especially when repeatedly removing and rebuilding the Docker container.

Getting Started

  1. Clone this repository to your local machine:

    git clone https://github.com/coredevel/nextjs-docker-compose.git
    cd nextjs-docker-compose
  2. Run the Docker container:

    docker-compose up --build
  3. Access the development environment through VS Code by attaching to container and opening the /usr/local/src/app folder

Using the Run Script

By default, there's a run script at ./scripts/run.sh that attempts to install dependencies from package.json on each container run. You can comment out the 2nd line of the script if you find it undesirable for your use case.

Adding New NPM Dependencies

To add new npm dependencies, either:

  1. Open an integrated terminal while attached to the running container within VS code and run npm install package-name as usual; or

  2. Open a terminal to the container via docker exec:

    docker exec -it name-of-container sh
    npm install package

nextjs-docker-compose's People

Contributors

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