Roberto Berto 5 年之前
父節點
當前提交
b927f53f93
共有 5 個文件被更改,包括 38 次插入2 次删除
  1. 8 0
      .dockerignore
  2. 17 0
      Dockerfile
  3. 12 0
      docker-compose.yml
  4. 1 1
      vycenter/vycenter/templates/base.html
  5. 0 1
      vycenter/vyos.py

+ 8 - 0
.dockerignore

@@ -0,0 +1,8 @@
+vycenter/db.sqlite3
+.git
+.DS_Store
+db.sqlite3
+*.code-workspace
+__pycache__
+*.pyc
+**/db.sqlite3

+ 17 - 0
Dockerfile

@@ -0,0 +1,17 @@
+FROM python:3
+ENV PYTHONUNBUFFERED 1
+RUN mkdir /code
+WORKDIR /code
+COPY requirements.txt /code/
+RUN pip install -r requirements.txt
+COPY vycenter/ /code/
+
+
+WORKDIR /code
+RUN python3 manage.py migrate
+
+# Server
+EXPOSE 8000
+STOPSIGNAL SIGINT
+ENTRYPOINT ["python", "manage.py"]
+CMD ["runserver", "0.0.0.0:8000"]

+ 12 - 0
docker-compose.yml

@@ -0,0 +1,12 @@
+version: "2.2"
+services:
+  django:
+    container_name: vycenter
+    build:
+      context: .
+      dockerfile: Dockerfile
+    image: vycenter
+    stdin_open: true
+    tty: true
+    ports:
+      - "8000:8000"

+ 1 - 1
vycenter/vycenter/templates/base.html

@@ -112,7 +112,7 @@
 
             
               <span id="vycenter-config-menu">Config</span>
-              <span id="vycenter-config-user">Usuário</span>
+              <span id="vycenter-config-user">User</span>
 
           </p>
         </form>

+ 0 - 1
vycenter/vyos.py

@@ -6,7 +6,6 @@ import sys
 #curl -k -X POST -F data='{"op": "set", "path": ["interfaces", "dummy", "dum1", "address"], "value": "203.0.113.76/32"}' -F key=a6ffb742a8a631a65b07ab2026258629da2632fd https://179.127.12.142:44302/configure
 
 sys.path.append('/var/secrets')
-import local
 
 from config.models import Instance