Skip to content

Commit 14590b7

Browse files
committed
Workflows for Docker images
1 parent 642f05c commit 14590b7

10 files changed

Lines changed: 572 additions & 0 deletions

File tree

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Sahred Docker image action
2+
3+
inputs:
4+
image:
5+
required: true
6+
tag:
7+
required: true
8+
branch:
9+
default: "master"
10+
push:
11+
default: false
12+
username:
13+
required: true
14+
password:
15+
required: true
16+
17+
runs:
18+
using: "composite"
19+
steps:
20+
- uses: actions/checkout@v3
21+
with:
22+
ref: ${{ inputs.branch }}
23+
- name: Set up Docker Buildx
24+
uses: docker/setup-buildx-action@v3
25+
- name: Login to Docker Hub
26+
uses: docker/login-action@v3
27+
with:
28+
username: ${{ inputs.username }}
29+
password: ${{ inputs.password }}
30+
- name: Build and push
31+
uses: docker/build-push-action@v5
32+
with:
33+
file: ./docker/${{ inputs.image }}/Dockerfile
34+
context: "./docker/${{ inputs.image }}/"
35+
push: ${{ inputs.push }}
36+
tags: giohappy/${{ inputs.image }}:${{ inputs.tag }}

.github/workflows/latest.yml

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
name: Docker Image (Build and Push)
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
7+
jobs:
8+
geoserver:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v3
12+
- uses: dorny/paths-filter@v2
13+
id: changes
14+
with:
15+
filters: |
16+
src:
17+
- 'docker/geoserver/**'
18+
- uses: ./.github/actions/build_and_push
19+
if: steps.changes.outputs.src == 'true'
20+
with:
21+
image: "geoserver"
22+
branch: "master"
23+
tag: "latest"
24+
push: true
25+
username: ${{ secrets.DOCKERHUB_USERNAME }}
26+
password: ${{ secrets.DOCKERHUB_TOKEN }}
27+
postgis:
28+
runs-on: ubuntu-latest
29+
steps:
30+
- uses: actions/checkout@v3
31+
- uses: dorny/paths-filter@v2
32+
id: changes
33+
with:
34+
filters: |
35+
src:
36+
- 'docker/postgis/**'
37+
- uses: ./.github/actions/build_and_push
38+
if: steps.changes.outputs.src == 'true'
39+
with:
40+
image: "postgis"
41+
branch: "master"
42+
tag: "latest"
43+
push: true
44+
username: ${{ secrets.DOCKERHUB_USERNAME }}
45+
password: ${{ secrets.DOCKERHUB_TOKEN }}
46+
nginx:
47+
runs-on: ubuntu-latest
48+
steps:
49+
- uses: actions/checkout@v3
50+
- uses: dorny/paths-filter@v2
51+
id: changes
52+
with:
53+
filters: |
54+
src:
55+
- 'docker/nginx/**'
56+
- uses: ./.github/actions/build_and_push
57+
if: steps.changes.outputs.src == 'true'
58+
with:
59+
image: "nginx"
60+
branch: "master"
61+
tag: "latest"
62+
push: true
63+
username: ${{ secrets.DOCKERHUB_USERNAME }}
64+
password: ${{ secrets.DOCKERHUB_TOKEN }}
65+
data_dir_conf:
66+
runs-on: ubuntu-latest
67+
steps:
68+
- uses: actions/checkout@v3
69+
- uses: dorny/paths-filter@v2
70+
id: changes
71+
with:
72+
filters: |
73+
src:
74+
- 'docker/data_dir_conf/**'
75+
- uses: ./.github/actions/build_and_push
76+
if: steps.changes.outputs.src == 'true'
77+
with:
78+
image: "data_dir_conf"
79+
branch: "master"
80+
tag: "latest"
81+
push: true
82+
username: ${{ secrets.DOCKERHUB_USERNAME }}
83+
password: ${{ secrets.DOCKERHUB_TOKEN }}
84+
letsencrypt:
85+
runs-on: ubuntu-latest
86+
steps:
87+
- uses: actions/checkout@v3
88+
- uses: dorny/paths-filter@v2
89+
id: changes
90+
with:
91+
filters: |
92+
src:
93+
- 'docker/letsencrypt/**'
94+
- uses: ./.github/actions/build_and_push
95+
if: steps.changes.outputs.src == 'true'
96+
with:
97+
image: "letsencrypt"
98+
branch: "master"
99+
tag: "latest"
100+
push: true
101+
username: ${{ secrets.DOCKERHUB_USERNAME }}
102+
password: ${{ secrets.DOCKERHUB_TOKEN }}
103+

.github/workflows/manual_build.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Build image (manual)
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
image:
7+
type: choice
8+
required: true
9+
description: Image
10+
options:
11+
- geoserver
12+
- geoserver_data_dir
13+
- nginx
14+
- postgis
15+
- letsencrypt
16+
tag:
17+
required: true
18+
description: Image tag
19+
push:
20+
type: boolean
21+
default: false
22+
description: Push the image to Docker Hub?
23+
24+
jobs:
25+
greet:
26+
runs-on: ubuntu-latest
27+
28+
steps:
29+
- uses: actions/checkout@v3
30+
- name: Set up Docker Buildx
31+
uses: docker/setup-buildx-action@v3
32+
- name: Login to Docker Hub
33+
uses: docker/login-action@v3
34+
with:
35+
username: ${{ secrets.DOCKERHUB_USERNAME }}
36+
password: ${{ secrets.DOCKERHUB_TOKEN }}
37+
- name: Build and push
38+
uses: docker/build-push-action@v5
39+
with:
40+
file: ./docker/${{ github.event.inputs.image }}/Dockerfile
41+
context: "./docker/${{ github.event.inputs.image }}/"
42+
push: ${{fromJSON(github.event.inputs.push)}}
43+
tags: giohappy/${{ github.event.inputs.image }}:${{ github.event.inputs.tag }}
44+
- name: Final message
45+
run: echo "Built ${{ github.event.inputs.image }} from branch ${{ github.event.inputs.branch }} (push ${{ fromJSON(github.event.inputs.push) }})"

.github/workflows/release.yml

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
name: Release Docker Image (Build and Push)
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
geoserver:
9+
if: ${{ contains(github.ref, 'geoserver_') }}
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: winterjung/split@v2
13+
id: split
14+
with:
15+
separator: "_"
16+
msg: ${{ github.ref }}
17+
- uses: actions/checkout@v3
18+
with:
19+
ref: ${{ github.ref }}
20+
- uses: ./.github/actions/build_and_push
21+
with:
22+
image: "geoserver"
23+
branch: ${{ github.ref }}
24+
tag: ${{ steps.split.outputs._1 }}
25+
push: true
26+
username: ${{ secrets.DOCKERHUB_USERNAME }}
27+
password: ${{ secrets.DOCKERHUB_TOKEN }}
28+
postgis:
29+
if: ${{ contains(github.ref, 'postgis_') }}
30+
runs-on: ubuntu-latest
31+
steps:
32+
- uses: winterjung/split@v2
33+
id: split
34+
with:
35+
separator: "_"
36+
msg: ${{ github.ref }}
37+
- uses: actions/checkout@v3
38+
with:
39+
ref: ${{ github.ref }}
40+
- uses: ./.github/actions/build_and_push
41+
with:
42+
image: "postgis"
43+
branch: ${{ github.ref }}
44+
tag: ${{ steps.split.outputs._1 }}
45+
push: true
46+
username: ${{ secrets.DOCKERHUB_USERNAME }}
47+
password: ${{ secrets.DOCKERHUB_TOKEN }}
48+
nginx:
49+
if: ${{ contains(github.ref, 'nginx_') }}
50+
runs-on: ubuntu-latest
51+
steps:
52+
- uses: winterjung/split@v2
53+
id: split
54+
with:
55+
separator: "_"
56+
msg: ${{ github.ref }}
57+
- uses: actions/checkout@v3
58+
with:
59+
ref: ${{ github.ref }}
60+
- uses: ./.github/actions/build_and_push
61+
with:
62+
image: "nginx"
63+
branch: ${{ github.ref }}
64+
tag: ${{ steps.split.outputs._1 }}
65+
push: true
66+
username: ${{ secrets.DOCKERHUB_USERNAME }}
67+
password: ${{ secrets.DOCKERHUB_TOKEN }}
68+
data_dir_conf:
69+
if: ${{ contains(github.ref, 'data-dir-conf_') }}
70+
runs-on: ubuntu-latest
71+
steps:
72+
- uses: winterjung/split@v2
73+
id: split
74+
with:
75+
separator: "_"
76+
msg: ${{ github.ref }}
77+
- uses: actions/checkout@v3
78+
with:
79+
ref: ${{ github.ref }}
80+
- uses: ./.github/actions/build_and_push
81+
with:
82+
image: "data-dir-conf"
83+
branch: ${{ github.ref }}
84+
tag: ${{ steps.split.outputs._1 }}
85+
push: true
86+
username: ${{ secrets.DOCKERHUB_USERNAME }}
87+
password: ${{ secrets.DOCKERHUB_TOKEN }}
88+
letsencrypt:
89+
if: ${{ contains(github.ref, 'letsencrypt_') }}
90+
runs-on: ubuntu-latest
91+
steps:
92+
- uses: winterjung/split@v2
93+
id: split
94+
with:
95+
separator: "_"
96+
msg: ${{ github.ref }}
97+
- uses: actions/checkout@v3
98+
with:
99+
ref: ${{ github.ref }}
100+
- uses: ./.github/actions/build_and_push
101+
with:
102+
image: "letsencrypt"
103+
branch: ${{ github.ref }}
104+
tag: ${{ steps.split.outputs._1 }}
105+
push: true
106+
username: ${{ secrets.DOCKERHUB_USERNAME }}
107+
password: ${{ secrets.DOCKERHUB_TOKEN }}

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Docker images for GeoNode services
2+
**This is a WIP. Further details will be provided in this README once the repo has been stabilized.**
3+
4+
This repository collects the configurations for the Docker images used by GeoNode and GeoNode project Docker compose files.
5+
It replaces the configurations defined in the following locations:
6+
- https://github.com/GeoNode/geonode-project/tree/master/docker
7+
- https://github.com/GeoNode/geonode/tree/master/scripts/docker (will be removed except the [GeoNode base image](https://github.com/GeoNode/geonode/tree/master/scripts/docker/base/ubuntu))
8+
- https://github.com/GeoNode/geoserver-docker (will be archived and deprecated)
9+
- https://github.com/GeoNode/data-docker (will be archived and deprecated)
10+
- https://github.com/GeoNode/nginx-docker (will be archived and deprecated)
11+
- https://github.com/GeoNode/postgis-docker (will be archived and deprecated)
12+
13+
The [configurations](https://github.com/GeoNode/geonode-project/tree/master/docker) in the GeoNode Project repository will by default inherit from these base images without further configurations. These configurations can be customized inside projects for any specific need.
14+

docker/data-dir-conf/Dockerfile

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
FROM alpine:latest
2+
MAINTAINER GeoNode development team
3+
4+
# Install curl in alpine 3.3+
5+
RUN apk --no-cache add curl
6+
7+
# Download required files
8+
RUN mkdir -p /tmp/geonode/downloaded
9+
ENV TEMP_DOWNLOADED /tmp/geonode/downloaded
10+
WORKDIR ${TEMP_DOWNLOADED}
11+
12+
ENV GEOSERVER_VERSION=2.15.2
13+
14+
ADD download.sh ${TEMP_DOWNLOADED}
15+
RUN chmod +x ${TEMP_DOWNLOADED}/download.sh
16+
RUN ${TEMP_DOWNLOADED}/download.sh $GEOSERVER_VERSION $TEMP_DOWNLOADED
17+
18+
# for debugging
19+
RUN ls -lart
20+
21+
# preparing the volume
22+
ENV BASE_GEOSERVER_DATA_DIR /geoserver_data
23+
RUN mkdir -p ${BASE_GEOSERVER_DATA_DIR}
24+
RUN cp -r ${TEMP_DOWNLOADED}/data ${BASE_GEOSERVER_DATA_DIR}
25+
VOLUME ${BASE_GEOSERVER_DATA_DIR}/data

0 commit comments

Comments
 (0)