diff --git a/.github/workflows/docker-compose.yml b/.github/workflows/docker-compose.yml deleted file mode 100644 index 8a2cef9..0000000 --- a/.github/workflows/docker-compose.yml +++ /dev/null @@ -1,12 +0,0 @@ -version: '3.8' - -services: - web: - image: capic/capic:0.1 - container_name: capic_container - command: bash -c "pip install Flask && python app.py" - volumes: - - ./app:/app - ports: - - "5000:5000" - diff --git a/.github/workflows/github-actions.yml b/.github/workflows/github-actions.yml index ebdc9f7..2ada1f3 100644 --- a/.github/workflows/github-actions.yml +++ b/.github/workflows/github-actions.yml @@ -54,7 +54,9 @@ jobs: username: ubuntu key: ${{ secrets.PRIVATE_KEY }} script: | - sudo docker-compose -f docker-compose.yml down sudo docker login -u ${{ secrets.DOCKERHUB_NAME }} -p ${{ secrets.DOCKERHUB_PASSWORD }} - sudo docker-compose -f docker-compose.yml pull - sudo docker-compose -f docker-compose.yml up -d + sudo docker-compose stop ${{ secrets.DOCKER_SERVICE_NAME }} + sudo docker-compose rm -f ${{ secrets.DOCKER_SERVICE_NAME }} + sudo docker pull ${{ secrets.DOCKERHUB_NAME }}/${{ secrets.DOCKERHUB_REPOSITORY}} + sudo docker tag ${{ secrets.DOCKERHUB_NAME }}/${{ secrets.DOCKERHUB_REPOSITORY}} ${{ secrets.DOCKER_IMAGE_NAME }} + sudo docker-compose up -d \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..96b2cf6 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,13 @@ +version: '3' +services: + flask: + container_name: server + image: flask + ports: + - "5000:5000" + networks: + - network + +networks: + network: + driver: bridge