Browse Source

加入gateway

owen-carter 6 years ago
parent
commit
5b833fb594
3 changed files with 55 additions and 3 deletions
  1. 0 1
      .dockerignore
  2. 1 2
      Dockerfile
  3. 54 0
      docker-compose.pro.yml

+ 0 - 1
.dockerignore

@@ -12,7 +12,6 @@ docker-compose*
 
 test
 screenshot
-migrations
 
 README.md
 LICENSE

+ 1 - 2
Dockerfile

@@ -1,7 +1,5 @@
 FROM python:2.7
 
-ENV FLASK_APP waller.py
-
 WORKDIR /usr/app/
 
 COPY ./requirements/prod.txt .
@@ -10,6 +8,7 @@ RUN mkdir logs
 
 RUN pip install -r prod.txt -i https://mirrors.aliyun.com/pypi/simple
 
+ENV FLASK_APP waller.py
 COPY . .
 RUN flask db upgrade
 

+ 54 - 0
docker-compose.pro.yml

@@ -0,0 +1,54 @@
+version: "3.7"
+
+services:
+
+  db:
+    image: mysql
+    ports:
+      - 0.0.0.0:3306:3306
+    expose:
+      - 3306
+    command: --default-authentication-plugin=mysql_native_password
+    environment:
+      MYSQL_ROOT_PASSWORD: walle
+      MYSQL_DATABASE: walle
+    volumes:
+      - ${HOME}/.walle/mysql:/var/lib/mysql
+    networks:
+      - walle-net
+    restart: always
+
+  adminer:
+    image: adminer
+    ports:
+      - 8080:8080
+    networks:
+      - walle-net
+    restart: always
+
+  web:
+    build: ./
+    depends_on:
+      - db
+    expose:
+      - 5000
+    environment:
+      - WALLE_SECRET="guess me out"
+    networks:
+      - walle-net
+    restart: always
+
+
+  gateway:
+    image: nginx
+    ports:
+      - 0.0.0.0:80:80
+    volumes:
+      - ./fe/:/data/web/:ro
+      - ./gateway/nginx/default.conf:/etc/nginx/conf.d/default.conf:ro
+    networks:
+      walle-net:
+    restart: always
+
+networks:
+  walle-net: ~