forked from COATnor/coat2pycsw
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rebuild Dockerfile/docker-compose files
- Using stable python:3.11.5-slim-bullseye image - Move Dockerfiles to ckan-pycsw folder. - Create GHCR files (Github Registry Container images). - Add PYCSW_DEV_PORT to avoid hardcode the dev_port. - Update README
- Loading branch information
Showing
18 changed files
with
170 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
PYCSW_PORT=8000 | ||
PYCSW_DEV_PORT=5678 | ||
|
||
# URLS | ||
CKAN_URL=http://localhost:5000/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,24 +14,26 @@ on: | |
env: | ||
REGISTRY: ghcr.io | ||
IMAGE_NAME: ${{ github.repository }}-dev | ||
CONTEXT: . | ||
DOCKERFILE: ./ckan-pycsw/Dockerfile.dev | ||
|
||
jobs: | ||
docker: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- | ||
name: Set up QEMU | ||
uses: docker/setup-qemu-action@v2 | ||
uses: docker/setup-qemu-action@v3 | ||
- | ||
name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
uses: docker/setup-buildx-action@v3 | ||
- | ||
name: Checkout | ||
uses: actions/checkout@v3 | ||
uses: actions/checkout@v4 | ||
- | ||
name: Login to registry | ||
if: github.event_name != 'pull_request' | ||
uses: docker/login-action@v2 | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
|
@@ -44,10 +46,18 @@ jobs: | |
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | ||
- | ||
name: Build and push | ||
uses: docker/build-push-action@v3 | ||
uses: docker/build-push-action@v5 | ||
with: | ||
push: ${{ github.event_name != 'pull_request' }} | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
context: . | ||
file: ./ckan-pycsw/Dockerfile.dev | ||
context: ${{ env.CONTEXT }} | ||
file: ${{ env.DOCKERFILE }} | ||
|
||
- | ||
name: Scan image | ||
uses: ISID/[email protected] | ||
with: | ||
tag: ${{ env.IMAGE_NAME }} | ||
path: ${{ env.CONTEXT }} | ||
dockerfile: ${{ env.DOCKERFILE }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
FROM python:3.11-slim-bullseye | ||
FROM python:3.11.5-slim-bullseye | ||
LABEL maintainer="[email protected]" | ||
|
||
ENV APP_DIR=/app | ||
|
@@ -25,7 +25,7 @@ COPY pyproject.toml pdm.lock . | |
|
||
RUN pdm install --no-self --group prod | ||
|
||
COPY pycsw/conf/pycsw.conf.template pycsw/entrypoint.sh . | ||
COPY ckan-pycsw/conf/pycsw.conf.template ckan-pycsw/docker-entrypoint.d/entrypoint.sh . | ||
COPY ckan2pycsw ckan2pycsw | ||
|
||
EXPOSE ${PYCSW_PORT}/TCP | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
FROM python:3.11-slim-bullseye | ||
FROM python:3.11.5-slim-bullseye | ||
LABEL maintainer="[email protected]" | ||
|
||
ENV APP_DIR=/app | ||
|
@@ -10,12 +10,13 @@ ENV CKAN_URL=http://localhost:5000/ | |
ENV PYCSW_PORT=8880 | ||
ENV PYCSW_URL=http://localhost:${PYCSW_PORT}/ | ||
ENV DEV_MODE=True | ||
ENV PYCSW_DEV_PORT=5678 | ||
ENV TIMEOUT=300 | ||
|
||
RUN apt-get -q -y update && \ | ||
apt-get install -y wget procps && \ | ||
DEBIAN_FRONTEND=noninteractive apt-get -yq install gettext-base && \ | ||
wget -O /wait-for https://raw.githubusercontent.com/eficode/wait-for/v2.2.3/wait-for && \ | ||
wget -O /wait-for https://raw.githubusercontent.com/eficode/wait-for/v2.2.4/wait-for && \ | ||
chmod +x /wait-for && \ | ||
python3 -m pip install pdm debugpy | ||
|
||
|
@@ -24,12 +25,12 @@ COPY pyproject.toml pdm.lock . | |
|
||
RUN pdm install --no-self --group prod | ||
|
||
COPY pycsw/conf/pycsw.conf.template pycsw/entrypoint_dev.sh . | ||
COPY ckan-pycsw/conf/pycsw.conf.template ckan-pycsw/docker-entrypoint.d/entrypoint_dev.sh . | ||
COPY ckan2pycsw ckan2pycsw | ||
|
||
EXPOSE ${PYCSW_PORT}/TCP | ||
EXPOSE 5678/TCP | ||
EXPOSE ${PYCSW_DEV_PORT}/TCP | ||
|
||
# Set entrypoint with debugpy | ||
ENTRYPOINT ["python3", "-m", "debugpy", "--listen", "0.0.0.0:5678", "--wait-for-client", "./entrypoint_dev.sh"] | ||
ENTRYPOINT ["/bin/bash", "-c", "python3 -m debugpy --listen 0.0.0.0:${PYCSW_DEV_PORT} --wait-for-client ./entrypoint_dev.sh"] | ||
CMD ["pdm", "run", "python3", "-m", "gunicorn", "pycsw.wsgi:application", "-b", "0.0.0.0:${PYCSW_PORT}"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
FROM ghcr.io/mjanez/ckan-pycsw:latest | ||
LABEL maintainer="[email protected]" | ||
|
||
ENV APP_DIR=/app | ||
ENV TZ=UTC | ||
RUN echo ${TZ} > /etc/timezone | ||
ENV PYCSW_CKAN_SCHEMA=iso19139_inspire | ||
ENV PYCSW_CONFIG=${APP_DIR}/pycsw.conf | ||
ENV CKAN_URL=http://localhost:5000/ | ||
ENV PYCSW_PORT=8000 | ||
ENV PYCSW_URL=http://localhost:${PYCSW_PORT}/ | ||
ENV DEV_MODE=False | ||
ENV TIMEOUT=300 | ||
ENV PYCSW_CRON_DAYS_INTERVAL=2 | ||
|
||
WORKDIR ${APP_DIR} | ||
|
||
COPY ckan-pycsw/conf/pycsw.conf.template ckan-pycsw/docker-entrypoint.d/entrypoint.sh . | ||
|
||
ENTRYPOINT ["/bin/bash", "./entrypoint.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
FROM ghcr.io/mjanez/ckan-pycsw-dev:latest | ||
LABEL maintainer="[email protected]" | ||
|
||
ENV APP_DIR=/app | ||
ENV TZ=UTC | ||
RUN echo ${TZ} > /etc/timezone | ||
ENV PYCSW_CKAN_SCHEMA=iso19139_inspire | ||
ENV PYCSW_CONFIG=${APP_DIR}/pycsw.conf | ||
ENV CKAN_URL=http://localhost:5000/ | ||
ENV PYCSW_PORT=8880 | ||
ENV PYCSW_URL=http://localhost:${PYCSW_PORT}/ | ||
ENV DEV_MODE=True | ||
ENV PYCSW_DEV_PORT=5678 | ||
ENV TIMEOUT=300 | ||
|
||
WORKDIR ${APP_DIR} | ||
|
||
COPY ckan-pycsw/conf/pycsw.conf.template ckan-pycsw/docker-entrypoint.d/entrypoint_dev.sh . | ||
|
||
EXPOSE ${PYCSW_PORT}/TCP | ||
EXPOSE ${PYCSW_DEV_PORT}/TCP | ||
|
||
# Set entrypoint with debugpy | ||
ENTRYPOINT ["/bin/bash", "-c", "python3 -m debugpy --listen 0.0.0.0:${PYCSW_DEV_PORT} --wait-for-client ./entrypoint_dev.sh"] | ||
CMD ["pdm", "run", "python3", "-m", "gunicorn", "pycsw.wsgi:application", "-b", "0.0.0.0:${PYCSW_PORT}"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
version: "3" | ||
|
||
services: | ||
ckan2pycsw: | ||
container_name: ckan-pycsw-dev | ||
build: | ||
context: . | ||
dockerfile: ckan-pycsw/Dockerfile.ghcr.dev | ||
env_file: | ||
- .env | ||
logging: | ||
driver: "json-file" | ||
options: | ||
max-size: "100m" | ||
max-file: "10" | ||
ports: | ||
- "0.0.0.0:${PYCSW_PORT}:${PYCSW_PORT}" | ||
# debugpy | ||
- "${PYCSW_DEV_PORT}:${PYCSW_DEV_PORT}" | ||
volumes: | ||
- ./log:${APP_DIR}/log | ||
- ./metadata:${APP_DIR}/metadata | ||
- ./ckan2pycsw:${APP_DIR}/ckan2pycsw | ||
networks: | ||
default: | ||
name: ckan2pycsw_default |
Oops, something went wrong.