restore build scripts..
Some checks failed
Build Docker Image on Commit / build-and-publish (push) Failing after 7s

This commit is contained in:
Merith-TK 2025-07-06 17:24:09 +01:00
parent 9749f2206e
commit ddff2599cf
3 changed files with 131 additions and 0 deletions

View file

@ -0,0 +1,47 @@
name: Build Docker Image on Commit
on:
push:
branches:
- main
tags:
- '!' # Exclude tags
jobs:
build-and-publish:
runs-on: docker-builder
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set REPO_VARS
id: repo-url
run: |
echo "REPO_HOST=$(echo "${{ github.server_url }}" | sed 's~http[s]*://~~g')" >> $GITHUB_ENV
echo "REPO_PATH=${{ github.repository }}" >> $GITHUB_ENV
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
driver: docker-container
driver-opts: |
network=host
- name: Login to OCI registry
run: |
echo "${{ secrets.OCI_TOKEN }}" | docker login $REPO_HOST -u "${{ secrets.OCI_USER }}" --password-stdin
- name: Build and push multi-arch Docker images
run: |
docker buildx build \
--platform linux/amd64,linux/arm64 \
--tag $REPO_HOST/$REPO_PATH:${{ github.sha }} \
--tag $REPO_HOST/$REPO_PATH:nightly \
--push \
.
- name: Cleanup
run: |
docker buildx prune -f
docker logout $REPO_HOST

View file

@ -0,0 +1,46 @@
name: Build and Publish Docker Image on Tag
on:
push:
tags:
- '*'
jobs:
build-and-publish:
runs-on: docker-builder
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set REPO_VARS
id: repo-url
run: |
echo "REPO_HOST=$(echo "${{ github.server_url }}" | sed 's~http[s]*://~~g')" >> $GITHUB_ENV
echo "REPO_PATH=${{ github.repository }}" >> $GITHUB_ENV
echo "TAG=${{ github.ref_name }}" >> $GITHUB_ENV
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
driver: docker-container
driver-opts: |
network=host
- name: Login to OCI registry
run: |
echo "${{ secrets.OCI_TOKEN }}" | docker login $REPO_HOST -u "${{ secrets.OCI_USER }}" --password-stdin
- name: Build and push Docker images
run: |
docker buildx build \
--platform linux/amd64,linux/arm64 \
--tag $REPO_HOST/$REPO_PATH:$TAG \
--tag $REPO_HOST/$REPO_PATH:latest \
--push \
.
- name: Cleanup
run: |
docker buildx prune -f
docker logout $REPO_HOST

38
Dockerfile.db Normal file
View file

@ -0,0 +1,38 @@
FROM postgres:16.6
# Metadata
LABEL maintainer="TAK Server Docker Setup"
LABEL description="PostgreSQL with PostGIS for TAK Server"
LABEL version="1.0"
# Install required packages
RUN apt-get update && apt-get install -y \
postgresql-16-postgis-3 \
openjdk-17-jdk \
curl \
&& rm -rf /var/lib/apt/lists/*
# Create necessary directories
RUN mkdir -p /opt/tak/db-utils \
&& mkdir -p /opt/tak/logs
# Copy database utilities and configuration
COPY data/takserver/db-utils/ /opt/tak/db-utils/
COPY config/postgres/ /docker-entrypoint-initdb.d/
# Set proper permissions
RUN chmod +x /opt/tak/db-utils/*.sh \
&& chmod +x /docker-entrypoint-initdb.d/*.sh
# Set environment variables with defaults (passwords should be set at runtime)
ENV POSTGRES_DB=cot \
POSTGRES_USER=martiuser
# Note: POSTGRES_PASSWORD should be set at runtime via docker-compose or container environment
# Note: Authentication method should be configured via PostgreSQL configuration files
# Expose PostgreSQL port
EXPOSE 5432
# Custom entrypoint that initializes TAK database
ENTRYPOINT ["/opt/tak/db-utils/configureInDocker.sh"]