Skip to content

Commit

Permalink
creating the docker image for nginx
Browse files Browse the repository at this point in the history
  • Loading branch information
Deepak Tiwari committed Sep 18, 2024
0 parents commit fc681b0
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 0 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/repository_nginx.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Build and Push Docker Image

on:
push:
tags:
- '*'

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Log in to DockerHub or other registry
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: username/projectname:${{ github.ref_name }}

2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
FROM nginx:1.27.0
COPY nginx.conf /etc/nginx/conf.d/default.conf
16 changes: 16 additions & 0 deletions nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
server {
listen *:80;

index index.html index.htm index.php;
autoindex on;

location / {
root /var/cache/packagesign;

autoindex on;
index index.html index.htm index.php;
}

real_ip_header X-Forwarded-For;
real_ip_recursive on;
}

0 comments on commit fc681b0

Please sign in to comment.