feat: create docker files for deployment

This commit is contained in:
Araozu 2024-10-06 20:41:11 -05:00
parent a0a8ebdfa6
commit e2be83ce24
3 changed files with 21 additions and 7 deletions

12
Jenkinsfile vendored
View File

@ -1,7 +1,7 @@
pipeline { pipeline {
agent { agent {
docker { docker {
image 'golang:1.23' image 'golang:1.23-alpine'
} }
} }
stages { stages {
@ -15,14 +15,12 @@ agent {
sh 'go build main.go' sh 'go build main.go'
} }
} }
stage('???') {
steps {
sh 'echo "TODO: call docker compose up"'
}
}
stage('Profit') { stage('Profit') {
steps { steps {
sh 'echo "done"' dir('docker') {
sh 'docker compose stop || true'
sh 'docker compose up --build -d'
}
} }
} }
} }

7
docker/Dockerfile Normal file
View File

@ -0,0 +1,7 @@
FROM alpine:3
COPY ../main .
COPY ../public .
CMD ["main"]

View File

@ -0,0 +1,9 @@
services:
dev.araozu.music:
container_name: music-to-go
build:
context: .
dockerfile: Dockerfile
ports:
- "8007:8007"
restart: unless-stopped