소스 검색

docker化应用

owen-carter 6 년 전
부모
커밋
ea6c2fd4c0
4개의 변경된 파일68개의 추가작업 그리고 0개의 파일을 삭제
  1. 16 0
      .dockerignore
  2. 13 0
      .editorconfig
  3. 10 0
      Dockerfile
  4. 29 0
      docker-compose.yml

+ 16 - 0
.dockerignore

@@ -0,0 +1,16 @@
+Dockerfile*
+docker-compose*
+
+.dockerignore
+.git
+.github
+.gitignore
+.vscode
+
+test
+screenshot
+migrations
+requirements
+
+README.md
+LICENSE

+ 13 - 0
.editorconfig

@@ -0,0 +1,13 @@
+# Editor configuration, see http://editorconfig.org
+root = true
+
+[*]
+charset = utf-8
+indent_style = space
+indent_size = 2
+insert_final_newline = true
+trim_trailing_whitespace = true
+
+[*.md]
+max_line_length = off
+trim_trailing_whitespace = false

+ 10 - 0
Dockerfile

@@ -0,0 +1,10 @@
+FROM python:2.7.1
+
+WORKDIR /usr/app
+COPY ./requirements/prod.txt ./requirements.txt
+RUN pip install -r requirements.txt -i https://mirrors.aliyun.com/pypi/simple
+
+COPY . .
+RUN sh admin.sh migration
+
+CMD python waller.py

+ 29 - 0
docker-compose.yml

@@ -0,0 +1,29 @@
+version: "3.6"
+
+services:
+
+  mysql:
+    image: mysql
+    container_name: inspector-mysql
+    ports:
+      - 3306:3306
+    environment:
+      MYSQL_ROOT_PASSWORD: walle
+      MYSQL_DATABASE: walle
+      MYSQL_USER: user
+      MYSQL_PASSWORD: password
+    volumes:
+      - ${HOME}/.walle/mysql:/var/lib/mysql
+      - ./walle.sql:/docker-entrypoint-initdb.d/walle.sql
+    network_mode: host
+    restart: always
+
+  web:
+    build: .
+    depends_on:
+      - mysql
+    ports:
+      - 0.0.0.0:5000:5000
+    network_mode: host
+    restart: always
+