Compare commits
15 Commits
b034546245
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 42c42e750e | |||
| c689426224 | |||
| 1649b9702c | |||
| 52b2daee6f | |||
| 5e4285e1ad | |||
| 99056b3b80 | |||
| 6871907324 | |||
| 5e1eb2fa7a | |||
| 869d2e1f21 | |||
| 09428a8414 | |||
| e645480f22 | |||
| f0577f55db | |||
| de8ef086f0 | |||
| 21bfd0565c | |||
| 525b041fd3 |
@@ -1,35 +1,36 @@
|
||||
variables:
|
||||
IMAGE: flask-demo:latest
|
||||
|
||||
volumes:
|
||||
- name: dockersock
|
||||
host:
|
||||
path: /var/run/docker.sock
|
||||
|
||||
steps:
|
||||
test:
|
||||
image: python:3.11
|
||||
image: "python:3.11"
|
||||
commands:
|
||||
- pip install -r requirements.txt
|
||||
- pytest -q
|
||||
when:
|
||||
event: [push, manual]
|
||||
|
||||
build:
|
||||
image: docker:27-cli
|
||||
image: "docker:27-cli"
|
||||
volumes:
|
||||
- name: dockersock
|
||||
path: /var/run/docker.sock
|
||||
environment:
|
||||
IMAGE: "flask-demo:latest"
|
||||
commands:
|
||||
- docker build -t ${IMAGE} .
|
||||
- docker build -t "$IMAGE" .
|
||||
when:
|
||||
event: [push, manual]
|
||||
|
||||
deploy:
|
||||
image: docker:27-cli
|
||||
image: "docker:27-cli"
|
||||
volumes:
|
||||
- name: dockersock
|
||||
path: /var/run/docker.sock
|
||||
commands:
|
||||
- docker compose up -d
|
||||
when:
|
||||
event:
|
||||
- push
|
||||
branch:
|
||||
- main
|
||||
event: [push, manual]
|
||||
branch: [main]
|
||||
|
||||
volumes:
|
||||
- name: dockersock
|
||||
host:
|
||||
path: /var/run/docker.sock
|
||||
|
||||
2
app.py
2
app.py
@@ -7,4 +7,4 @@ def home():
|
||||
return render_template("index.html", title="Flask CI/CD demo")
|
||||
|
||||
if __name__ == "__main__":
|
||||
app.run(host="0.0.0.0", port=8000) # внутри контейнера слушаем 8000
|
||||
app.run(host="0.0.0.0", port=8008) # внутри контейнера слушаем 8000
|
||||
|
||||
@@ -4,5 +4,5 @@ services:
|
||||
image: flask-demo:latest
|
||||
container_name: flask-demo
|
||||
ports:
|
||||
- "8888:8888"
|
||||
- "8008:8008"
|
||||
restart: unless-stopped
|
||||
|
||||
Reference in New Issue
Block a user