Skip to content

Commit 8c07ce0

Browse files
committed
Dockerfile and workflow
1 parent d7d3f04 commit 8c07ce0

File tree

3 files changed

+65
-0
lines changed

3 files changed

+65
-0
lines changed

.github/workflows/ci.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: CI Pipeline
2+
3+
concurrency:
4+
group: ci
5+
cancel-in-progress: true
6+
7+
on:
8+
push:
9+
branches:
10+
- main
11+
12+
jobs:
13+
ci:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v4
18+
19+
- name: Login to Docker Hub
20+
uses: docker/login-action@v3
21+
with:
22+
username: ${{ vars.DOCKERHUB_USERNAME }}
23+
password: ${{ secrets.DOCKERHUB_TOKEN }}
24+
25+
- name: Set up Docker Buildx
26+
uses: docker/setup-buildx-action@v3
27+
28+
- name: Build and push
29+
uses: docker/build-push-action@v6
30+
with:
31+
file: ./Dockerfile
32+
context: .
33+
push: true
34+
tags: mltshp/nginx:latest

Dockerfile

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
FROM alpine:3.21
2+
LABEL maintainer="[email protected]"
3+
4+
RUN apk add --no-cache \
5+
nginx \
6+
nginx-mod-http-upload
7+
8+
RUN mkdir -p \
9+
/mnt/tmpuploads/0 \
10+
/mnt/tmpuploads/1 \
11+
/mnt/tmpuploads/2 \
12+
/mnt/tmpuploads/3 \
13+
/mnt/tmpuploads/4 \
14+
/mnt/tmpuploads/5 \
15+
/mnt/tmpuploads/6 \
16+
/mnt/tmpuploads/7 \
17+
/mnt/tmpuploads/8 \
18+
/mnt/tmpuploads/9 && \
19+
chmod 777 /mnt/tmpuploads/* && \
20+
mkdir -p /srv/mltshp.com/uploaded /srv/mltshp.com/bin /srv/mltshp.com/logs && \
21+
adduser -D mltshp && \
22+
chown -R mltshp /srv/mltshp.com
23+
24+
ADD start-nginx.sh /srv/mltshp.com/bin/start-nginx.sh
25+
RUN chmod +x /srv/mltshp.com/bin/start-nginx.sh
26+
27+
EXPOSE 80
28+
CMD ["/srv/mltshp.com/bin/start-nginx.sh"]

start-nginx.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/sh
2+
echo resolver $(awk 'BEGIN{ORS=" "} $1=="nameserver" {print $2}' /etc/resolv.conf) ";" > /etc/nginx/resolvers.conf
3+
exec /usr/sbin/nginx -g 'daemon off;'

0 commit comments

Comments
 (0)