Skip to content

Commit 768dcb6

Browse files
committed
build
1 parent a9cb883 commit 768dcb6

File tree

3 files changed

+68
-4
lines changed

3 files changed

+68
-4
lines changed

.github/workflows/build-image.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: Create and publish a Docker image
2+
3+
# Configures this workflow to run every time a tag is pushed.
4+
on:
5+
push:
6+
tags:
7+
- '*'
8+
9+
# Defines two custom environment variables for the workflow. These are used for the Container registry domain, and a name for the Docker image that this workflow builds.
10+
env:
11+
REGISTRY: ghcr.io
12+
IMAGE_NAME: ${{ github.repository }}
13+
14+
# There is a single job in this workflow. It's configured to run on the latest available version of Ubuntu.
15+
jobs:
16+
build-and-push-image:
17+
runs-on: ubuntu-latest
18+
# Sets the permissions granted to the `GITHUB_TOKEN` for the actions in this job.
19+
permissions:
20+
contents: read
21+
packages: write
22+
attestations: write
23+
id-token: write
24+
steps:
25+
- name: Checkout repository
26+
uses: actions/checkout@v4
27+
28+
- name: Log in to the Container registry
29+
uses: docker/login-action@v2
30+
with:
31+
registry: ${{ env.REGISTRY }}
32+
username: ${{ github.actor }}
33+
password: ${{ secrets.GITHUB_TOKEN }}
34+
35+
- name: Extract metadata (tags, labels) for Docker
36+
id: meta
37+
uses: docker/metadata-action@v4
38+
with:
39+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
40+
tags: |
41+
type=ref,event=tag
42+
labels: |
43+
type=ref,event=tag
44+
45+
- name: Build and push Docker image
46+
id: push
47+
uses: docker/build-push-action@v4
48+
with:
49+
context: .
50+
push: true
51+
tags: ${{ steps.meta.outputs.tags }}
52+
labels: ${{ steps.meta.outputs.labels }}
53+
54+
- name: Generate artifact attestation
55+
uses: actions/attest-build-provenance@v1
56+
with:
57+
subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}}
58+
subject-digest: ${{ steps.push.outputs.digest }}
59+
push-to-registry: true

Dockerfile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Use the official Nginx image as a base
2+
FROM nginx:latest
3+
4+
# Copy the custom Nginx configuration file to the container
5+
COPY nginx.conf /etc/nginx/nginx.conf
6+
7+
EXPOSE 80

docker-compose.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
version: '3.7'
22
services:
3-
nginx:
4-
image: nginx:latest
5-
volumes:
6-
- ./nginx:/etc/nginx/
3+
nginx-proxy:
4+
image: ghcr.io/andreitere/coolify-nginx-reverse-proxy:${VERSION:-latest}

0 commit comments

Comments
 (0)