From c0de98238c7d9bc66d7a84f0d029473aabe4f0c3 Mon Sep 17 00:00:00 2001 From: RainSun Date: Sat, 26 Dec 2020 21:27:10 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4yml?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitlab-ci.yml | 2 -- Dockerfile | 4 ++-- go.sh | 2 +- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index f0f0ce5..9aa780a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -45,7 +45,6 @@ pvedeploy: - docker login --username=${DOCKER_USERNAME} --password=${DOCKER_PASSWORD} ${DOCKER_REGION} - docker pull ${IMAGE_NAME} - docker run -t -d --name ${APP_NAME} -p 8080:80 ${IMAGE_NAME} - - gunicorn api:app -c gunicorn.conf.py cache: policy: pull @@ -72,7 +71,6 @@ ali2deploy: - docker login --username=${DOCKER_USERNAME} --password=${DOCKER_PASSWORD} ${DOCKER_REGION} - docker pull ${IMAGE_NAME} - docker run -t -d --name ${APP_NAME} -p 127.0.0.1:5012:80 ${IMAGE_NAME} - - gunicorn api:app -c gunicorn.conf.py cache: policy: pull when: manual diff --git a/Dockerfile b/Dockerfile index 2f4e320..626891b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,5 +2,5 @@ FROM python:3.7-alpine COPY requirements.txt /app/requirements.txt WORKDIR /app RUN pip install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple -COPY . /app -CMD ["python"] \ No newline at end of file +COPY . . +CMD sh go.sh && python \ No newline at end of file diff --git a/go.sh b/go.sh index 1edbaf6..344c3a0 100644 --- a/go.sh +++ b/go.sh @@ -1,3 +1,3 @@ #!/bin/sh echo start -gunicorn api:app -c gunicorn.conf.py \ No newline at end of file +exec gunicorn api:app -c gunicorn.conf.py \ No newline at end of file