diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..7d9ecf6 --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +.env + +# The binary +card-jong-be diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..0e3e81e --- /dev/null +++ b/Dockerfile @@ -0,0 +1,6 @@ +FROM debian:bookworm +EXPOSE 8080:8080 + +# Copy the backend binary +COPY ./card-jong-be . +ENTRYPOINT ["card-jong-be"] diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 0000000..b69be8b --- /dev/null +++ b/Jenkinsfile @@ -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" + } + } + } +} diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..495277a --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,8 @@ +services: + web: + container_name: rimajon2-be + restart: on-failure + build: . + ports: + - "9126:8080" +