Jenkins & docker config

master
Araozu 2024-05-08 08:57:36 -05:00
parent 10a196533e
commit e68245273d
4 changed files with 40 additions and 0 deletions

4
.gitignore vendored Normal file
View File

@ -0,0 +1,4 @@
.env
# The binary
card-jong-be

6
Dockerfile Normal file
View File

@ -0,0 +1,6 @@
FROM debian:bookworm
EXPOSE 8080:8080
# Copy the backend binary
COPY ./card-jong-be .
ENTRYPOINT ["card-jong-be"]

22
Jenkinsfile vendored Normal file
View File

@ -0,0 +1,22 @@
pipeline {
agent any
stages {
stage('Build binary') {
agent {
docker {
image "golang:1.22-bookworm"
reuseNode true
}
}
steps {
sh 'go build'
}
}
stage("Deploy") {
steps {
sh "docker compose up --build -d"
}
}
}
}

8
docker-compose.yml Normal file
View File

@ -0,0 +1,8 @@
services:
web:
container_name: rimajon2-be
restart: on-failure
build: .
ports:
- "9126:8080"