Giter Site home page Giter Site logo

docker_postgresql_template's Introduction

概要

  • postgresql を docker コンテナ内で動かすためのプロジェクト

前提

  • script 配下に初期設定用の sql を配置
    • DB 作成
    • スキーマ作成
    • ロール作成
    • 権限の追加
    • テーブルの作成
    • テストデータの追加
  • 本番用・開発用ともに、名前付きボリュームを指定して使用する
  • 本番用と開発用で docker-compose.yml のファイルを分ける
    用途 ファイル 備考
    本番用 docker-compose.yml db-store という名前付きボリュームを使う
    開発用 docker-compose.dev.yml db-store-dev という名前付きボリュームを使う

コマンド

開発

# コマンド
docker compsoe -f docker-compose.dev.yml up -d

# 起動・終了スクリプト
sh bin/dev.sh

# イメージ・ボリュームの削除も含めた起動・終了スクリプト
sh bin/dev_rebuild.sh

本番

# コマンド
docker compsoe up -d

# 起動・終了スクリプト
sh bin/prod.sh

# イメージ・ボリュームの削除も含めた起動・終了スクリプト
sh bin/prod_rebuild.sh

注意点

  • イメージ削除、キャッシュ削除はこまめにする
    • docker image rm イメージ名
    • docker builder prune

参考

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.