GithubHelp home page GithubHelp logo

docker's Introduction

Docker + Flask のボイラープレート

Usage(使い方)

1. このテンプレートrepoから自分のリポジトリを作成

img

2. .env.sampleを参考に.envファイルを.env.sampleと同じ場所に作成

3. Dockerを使ってビルド => アップ

Dockerが入ってないと動きません

$ make build_up

これでサーバーがたちます http://localhost:8000 にアクセスすればみれます

基礎フォルダ構造の解説

.
├── Dockerfile              // アプリケーション自体のDockerfile
├── Makefile                // `make XXX`みたいなコマンドでいろんなコマンドを簡略化するためのファいうr
├── README.md               // まず読みましょうというもの
├── .docker                 // アプリケーション以外のdockerで立ち上げるものたち
│   ├── db
│   │   ├── initializers/01_createdb.sql    // サーバー立ち上げた時にこの内容によってデフォルトのROLEとDBができる         
│   │   └── data/           // 実際のデータベースのデータが同期される
│   ├── nginx
│   │   ├── app.conf        // Nginxの設定         
│   │   └── Dockerfile
│   └── redis               // 非同期ジョブ実行の際に使われる揮発性DB
├── app                     // アプリケーションのソースコードが入るフォルダ *1
│   ├── __init__.py
│   ├── application.py      // アプリケーションに様々なパッケージを適用して初期化する
│   ├── config.py           // アプリケーションの設定
│   ├── database.py         // データベースの初期化
│   ├── jobs                // 非同期などで実行したいジョブを入れる
│   │   └── __init__.py
│   ├── lib                 // アプリ内で使う独自ライブラリなどを配置
│   │   └── __init__.py
│   ├── models              // モデルを入れる
│   │   └── __init__.py
│   ├── static              // 画像やスタイルシートを入れる
│   │   ├── img
│   │   ├── javascript
│   │   └── stylesheet
│   ├── tasks.py            // celeryに渡したいジョブやライブラリなどをimport
│   ├── templates           // テンプレートが入る
│   ├── tests               // pytestによって実行したいテストを入れる
│   │   └── __init__.py
│   └── views               // viewが入る => views.pyのように1つのファイルにしてもいい
│       └── __init__.py
├── docker-compose.yml      
├── guniconf.py             // gunicornの設定
├── run.py                  // 起動用ファイル
└── tmp                     // プログラムによって一時的に生成されるファイルなどを格納する用のフォルダ
    └── sockets             // ソケットファイルがはいる

*1 => 独自のプロジェクト名・アプリ名に変えてもいいが、ソースコード内のパッケージ名も変える必要がある

docker's People

Contributors

ganfxdd avatar

Watchers

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