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