GithubHelp home page GithubHelp logo

harveyvd / docker-persistent-stack Goto Github PK

View Code? Open in Web Editor NEW

This project forked from minhpq331/docker-persistent-stack

0.0 1.0 0.0 14 KB

Docker resource to create persistent stack for development purpose with 1 command

License: MIT License

Shell 100.00%

docker-persistent-stack's Introduction

Docker Persistent Stack

Docker resources to create persistent stack for development purpose with 1 command

Available snippets

How to use

It's easy, just follow these steps:

Clone this repository:

$ git clone https://github.com/minhpq331/docker-persistent-stack.git
$ cd docker-persistent-stack

Make environment file, change your compose project name and put your uid and gid in

$ cp .env.example .env
$ echo $(id -u):$(id -g)
1000:1000
# This is your uid and gid, copy all this line and paste it in .env file

Choose your persistent stack from available snippets or write yours. Put it in docker-compose.yml

version: '2'

services:
    mongo:
        container_name: mongo
        image: mongo:latest
        volumes:
            - ./data/mongo:/data/db
        user: "${UID_GID}"
        ports:
            - "27017:27017"
        networks:
            - common
        restart: always    

    redis:
        container_name: redis
        image: redis:alpine
        command: ["redis-server", "--appendonly", "yes"]
        volumes:
            - ./data/redis:/data
        user: "${UID_GID}"
        ports:
            - "6379:6379"
        networks:
            - common
        restart: always

networks:
    common:

Start docker compose

$ docker-compose up

Or start with interactive mode, you can close your terminal with your stack keep running

$ docker-compose up &

Useful commands

If you want to keep your stack autorun from now on, make docker service autorun with your marchine and start docker-compose with interactive mode.

If you want to stop using this stack, simply run below commands:

$ cd docker-persistent-stack
$ docker-compose down

If you want to cleanup one of your service data file, run this command:

$ cd docker-persistent-stack
$ bash script/clean_data.sh ./data/mongo
# Change ./data/mongo to your service data folder

docker-persistent-stack's People

Contributors

minhpq331 avatar

Watchers

James Cloos 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.