Adds docker and woodpecker files
This commit is contained in:
6
.dockerignore
Normal file
6
.dockerignore
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
.git/
|
||||||
|
.gradle/
|
||||||
|
build/
|
||||||
|
Claude Notes/
|
||||||
|
*.md
|
||||||
|
.gitignore
|
||||||
15
.woodpecker.yaml
Normal file
15
.woodpecker.yaml
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
when:
|
||||||
|
branch: main
|
||||||
|
event:
|
||||||
|
- push
|
||||||
|
- manual
|
||||||
|
steps:
|
||||||
|
- name: build
|
||||||
|
image: woodpeckerci/plugin-docker-buildx
|
||||||
|
settings:
|
||||||
|
repo: git.halfbinary.net/${CI_REPO_OWNER}/scavengerhunt-api
|
||||||
|
registry: git.halfbinary.net
|
||||||
|
tags: ${CI_PIPELINE_NUMBER}
|
||||||
|
username: ${CI_REPO_OWNER}
|
||||||
|
password:
|
||||||
|
from_secret: docker_password
|
||||||
14
Dockerfile
Normal file
14
Dockerfile
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
FROM amazoncorretto:21-alpine-jdk AS build
|
||||||
|
WORKDIR /app
|
||||||
|
COPY gradlew .
|
||||||
|
COPY gradle/ gradle/
|
||||||
|
COPY build.gradle.kts settings.gradle.kts ./
|
||||||
|
RUN ./gradlew dependencies --no-daemon
|
||||||
|
COPY src/ src/
|
||||||
|
RUN ./gradlew bootJar --no-daemon
|
||||||
|
|
||||||
|
FROM amazoncorretto:21-alpine-jdk
|
||||||
|
WORKDIR /app
|
||||||
|
COPY --from=build /app/build/libs/*.jar app.jar
|
||||||
|
EXPOSE 8080
|
||||||
|
ENTRYPOINT ["java", "-jar", "app.jar"]
|
||||||
78
docker-compose.yml
Normal file
78
docker-compose.yml
Normal file
@@ -0,0 +1,78 @@
|
|||||||
|
# All services use host networking so inter-service traffic goes over loopback with no bridge overhead.
|
||||||
|
# Ports (all bound directly on the host):
|
||||||
|
# API: 8080
|
||||||
|
# MariaDB: 3306
|
||||||
|
# Adminer: 8888
|
||||||
|
# MinIO API: 9000
|
||||||
|
# MinIO Console: 9001
|
||||||
|
|
||||||
|
services:
|
||||||
|
mariadb:
|
||||||
|
image: mariadb:11
|
||||||
|
network_mode: host
|
||||||
|
environment:
|
||||||
|
MYSQL_ROOT_PASSWORD: ${DB_ROOT_PASSWORD}
|
||||||
|
MYSQL_DATABASE: ${DB_NAME}
|
||||||
|
MYSQL_USER: ${DB_USER}
|
||||||
|
MYSQL_PASSWORD: ${DB_PASSWORD}
|
||||||
|
volumes:
|
||||||
|
- mariadb_data:/var/lib/mysql
|
||||||
|
healthcheck:
|
||||||
|
test: ["CMD", "healthcheck.sh", "--connect", "--innodb_initialized"]
|
||||||
|
start_period: 10s
|
||||||
|
interval: 10s
|
||||||
|
timeout: 5s
|
||||||
|
retries: 5
|
||||||
|
restart: unless-stopped
|
||||||
|
|
||||||
|
adminer:
|
||||||
|
image: adminer
|
||||||
|
network_mode: host
|
||||||
|
command: php -S [::]:8888 -t /var/www/html
|
||||||
|
restart: unless-stopped
|
||||||
|
|
||||||
|
minio:
|
||||||
|
image: minio/minio
|
||||||
|
network_mode: host
|
||||||
|
command: server /data --console-address :9001
|
||||||
|
environment:
|
||||||
|
MINIO_ROOT_USER: ${MINIO_ACCESS_KEY}
|
||||||
|
MINIO_ROOT_PASSWORD: ${MINIO_SECRET_KEY}
|
||||||
|
volumes:
|
||||||
|
- minio_data:/data
|
||||||
|
healthcheck:
|
||||||
|
test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"]
|
||||||
|
start_period: 10s
|
||||||
|
interval: 10s
|
||||||
|
timeout: 5s
|
||||||
|
retries: 5
|
||||||
|
restart: unless-stopped
|
||||||
|
|
||||||
|
api:
|
||||||
|
build: .
|
||||||
|
network_mode: host
|
||||||
|
environment:
|
||||||
|
DB_URL: jdbc:mariadb://localhost:3306/${DB_NAME}
|
||||||
|
DB_USER: ${DB_USER}
|
||||||
|
DB_PASSWORD: ${DB_PASSWORD}
|
||||||
|
JWT_SECRET: ${JWT_SECRET}
|
||||||
|
MINIO_ENDPOINT: http://localhost:9000
|
||||||
|
MINIO_ACCESS_KEY: ${MINIO_ACCESS_KEY}
|
||||||
|
MINIO_SECRET_KEY: ${MINIO_SECRET_KEY}
|
||||||
|
MINIO_BUCKET: ${MINIO_BUCKET}
|
||||||
|
depends_on:
|
||||||
|
mariadb:
|
||||||
|
condition: service_healthy
|
||||||
|
minio:
|
||||||
|
condition: service_healthy
|
||||||
|
healthcheck:
|
||||||
|
test: ["CMD", "curl", "-f", "http://localhost:8080/actuator/health"]
|
||||||
|
start_period: 30s
|
||||||
|
interval: 15s
|
||||||
|
timeout: 5s
|
||||||
|
retries: 5
|
||||||
|
restart: unless-stopped
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
mariadb_data:
|
||||||
|
minio_data:
|
||||||
Reference in New Issue
Block a user