main: Added docker build for nginx
This commit is contained in:
parent
f23f9a7dc4
commit
e0b455b6b4
57
.gitea/workflows/release.yml
Normal file
57
.gitea/workflows/release.yml
Normal file
@ -0,0 +1,57 @@
|
|||||||
|
name: Build Docker for Release
|
||||||
|
run-name: Build Docker Images
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
Build Container AMD:
|
||||||
|
runs-on: [ubuntu-latest, amd]
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
- name: Install Docker
|
||||||
|
run : |
|
||||||
|
apt-get install ca-certificates curl gnupg
|
||||||
|
install -m 0755 -d /etc/apt/keyrings
|
||||||
|
curl -fsSL https://download.docker.com/linux/debian/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg
|
||||||
|
chmod a+r /etc/apt/keyrings/docker.gpg
|
||||||
|
echo "deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian "$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null
|
||||||
|
apt-get update
|
||||||
|
apt-get install docker-ce-cli -y
|
||||||
|
- name: Build Docker image
|
||||||
|
run : |
|
||||||
|
echo "${{ secrets.DOCKERGIT_TOKEN }}" | docker login git.woodburn.au -u nathanwoodburn --password-stdin
|
||||||
|
tag=${GITHUB_REF#refs/tags/}
|
||||||
|
tag=${tag//\//-}
|
||||||
|
echo "tag=$tag"
|
||||||
|
docker build -t nginx:$tag .
|
||||||
|
docker tag nginx:$tag git.woodburn.au/nathanwoodburn/nginx:$tag
|
||||||
|
docker push git.woodburn.au/nathanwoodburn/nginx:$tag
|
||||||
|
docker tag nginx:$tag git.woodburn.au/nathanwoodburn/nginx:latest
|
||||||
|
docker push git.woodburn.au/nathanwoodburn/nginx:latest
|
||||||
|
|
||||||
|
Build Container ARM:
|
||||||
|
runs-on: [ubuntu-latest, arm]
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
- name: Install Docker
|
||||||
|
run : |
|
||||||
|
apt-get install ca-certificates curl gnupg
|
||||||
|
install -m 0755 -d /etc/apt/keyrings
|
||||||
|
curl -fsSL https://download.docker.com/linux/debian/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg
|
||||||
|
chmod a+r /etc/apt/keyrings/docker.gpg
|
||||||
|
echo "deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian "$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null
|
||||||
|
apt-get update
|
||||||
|
apt-get install docker-ce-cli -y
|
||||||
|
- name: Build Docker image
|
||||||
|
run : |
|
||||||
|
echo "${{ secrets.DOCKERGIT_TOKEN }}" | docker login git.woodburn.au -u nathanwoodburn --password-stdin
|
||||||
|
tag=${GITHUB_REF#refs/tags/}
|
||||||
|
tag=${tag//\//-}
|
||||||
|
echo "tag=$tag"
|
||||||
|
docker build -t nginx:$tag .
|
||||||
|
docker tag nginx:$tag git.woodburn.au/nathanwoodburn/nginx:$tag-arm
|
||||||
|
docker push git.woodburn.au/nathanwoodburn/nginx:$tag-arm
|
||||||
|
docker tag nginx:$tag git.woodburn.au/nathanwoodburn/nginx:latest-arm
|
||||||
|
docker push git.woodburn.au/nathanwoodburn/nginx:latest-arm
|
4
Dockerfile
Normal file
4
Dockerfile
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
FROM nginx:latest
|
||||||
|
# Add custom nginx config
|
||||||
|
COPY ./nginx.conf /etc/nginx/conf.d/default.conf
|
||||||
|
|
14
nginx.conf
Normal file
14
nginx.conf
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
server {
|
||||||
|
listen 80;
|
||||||
|
index index.html;
|
||||||
|
|
||||||
|
root /usr/share/nginx/html;
|
||||||
|
|
||||||
|
location / {
|
||||||
|
try_files $uri $uri/ /index.html;
|
||||||
|
}
|
||||||
|
|
||||||
|
location ~ \.html$ {
|
||||||
|
try_files $uri =404;
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user