diff --git a/Jenkinsfile b/Jenkinsfile index 66f79fc..6b17f65 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,7 +1,7 @@ pipeline { agent { docker { - image 'golang:1.23' + image 'golang:1.23-alpine' } } stages { @@ -15,14 +15,12 @@ agent { sh 'go build main.go' } } - stage('???') { - steps { - sh 'echo "TODO: call docker compose up"' - } - } stage('Profit') { steps { - sh 'echo "done"' + dir('docker') { + sh 'docker compose stop || true' + sh 'docker compose up --build -d' + } } } } diff --git a/docker/Dockerfile b/docker/Dockerfile new file mode 100644 index 0000000..596b169 --- /dev/null +++ b/docker/Dockerfile @@ -0,0 +1,7 @@ +FROM alpine:3 + +COPY ../main . +COPY ../public . + +CMD ["main"] + diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml new file mode 100644 index 0000000..5a16eff --- /dev/null +++ b/docker/docker-compose.yml @@ -0,0 +1,9 @@ +services: + dev.araozu.music: + container_name: music-to-go + build: + context: . + dockerfile: Dockerfile + ports: + - "8007:8007" + restart: unless-stopped