Skip to content

Commit

Permalink
Merge pull request #13 from mjanez/main
Browse files Browse the repository at this point in the history
Fix docker-compose files and add docker-dev workflow
  • Loading branch information
mjanez authored Sep 7, 2023
2 parents 75d1243 + 100694d commit 0dce414
Show file tree
Hide file tree
Showing 4 changed files with 99 additions and 1 deletion.
51 changes: 51 additions & 0 deletions .github/workflows/docker-dev.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Docker

on:
push:
branches:
- main
- latest
tags:
- 'v*.*.*'
pull_request:
branches:
- main

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}-dev

jobs:
docker:
runs-on: ubuntu-latest
steps:
-
name: Set up QEMU
uses: docker/setup-qemu-action@v2
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
-
name: Checkout
uses: actions/checkout@v3
-
name: Login to registry
if: github.event_name != 'pull_request'
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
-
name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
-
name: Build and push
uses: docker/build-push-action@v3
with:
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
26 changes: 26 additions & 0 deletions Dockerfile.ghcr
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
FROM ghcr.io/mjanez/ckan-ogc:latest
LABEL maintainer="mnl.janez@gmail.com"

ENV APP_DIR=/app
ENV TZ=UTC
RUN echo ${TZ} > /etc/timezone
ENV CKAN_URL=http://localhost:5000/
ENV PYCSW_URL=http://localhost:8000/
ENV CKAN_API_KEY=ckan-api-key
ENV DEFAULT_LICENSE=http://creativecommons.org/licenses/by/4.0/
ENV DEFAULT_LICENSE_ID=cc-by
ENV DEV_MODE=False
ENV TIMEOUT=300
ENV SSL_UNVERIFIED_MODE=False

WORKDIR ${APP_DIR}
COPY pyproject.toml pdm.lock .

RUN pdm install --no-self --group prod

COPY ckan-ogc/conf/config.yaml.template config.yaml
COPY ckan-ogc/entrypoint.sh entrypoint.sh
COPY ogc2ckan ogc2ckan
COPY data data

ENTRYPOINT ["/bin/bash", "./entrypoint.sh"]
3 changes: 2 additions & 1 deletion docker-compose.dev.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: ckan-ogc
version: "3"

services:
ogc2ckan:
container_name: ckan-ogc-dev
Expand Down
20 changes: 20 additions & 0 deletions docker-compose.ghcr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
version: "3"

services:
ogc2ckan:
container_name: ckan-ogc
build:
context: .
dockerfile: Dockerfile.ghcr
env_file:
- .env
logging:
driver: "json-file"
options:
max-size: "100m"
max-file: "10"
volumes:
- ./log:${APP_DIR}/log
- ./metadata:${APP_DIR}/metadata
restart: on-failure:3
network_mode: host

0 comments on commit 0dce414

Please sign in to comment.