Skip to content

Commit 5735ef0

Browse files
committed
Initial commit
0 parents  commit 5735ef0

File tree

5 files changed

+100
-0
lines changed

5 files changed

+100
-0
lines changed

.github/workflows/deploy.yml

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Deploy
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
outputs:
11+
tag: ${{ steps.meta.outputs.tags }}
12+
steps:
13+
- uses: actions/checkout@v4
14+
15+
- uses: docker/metadata-action@v5
16+
id: meta
17+
with:
18+
images: ghcr.io/${{ github.repository }}
19+
tags: type=sha
20+
21+
- uses: docker/setup-qemu-action@v3
22+
with:
23+
platforms: arm64
24+
25+
- uses: docker/setup-buildx-action@v3
26+
with:
27+
platforms: linux/arm64
28+
29+
- uses: docker/login-action@v3
30+
with:
31+
registry: ghcr.io
32+
username: ${{ github.actor }}
33+
password: ${{ secrets.GITHUB_TOKEN }}
34+
35+
- uses: docker/build-push-action@v5
36+
with:
37+
context: .
38+
platforms: linux/arm64
39+
push: true
40+
tags: ${{ steps.meta.outputs.tags }}

Dockerfile

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
FROM ubuntu:mantic as builder
2+
ARG CHISEL_VER=0.9.0
3+
WORKDIR /opt
4+
ADD https://github.com/canonical/chisel/releases/download/v${CHISEL_VER}/chisel_v${CHISEL_VER}_linux_arm64.tar.gz chisel.tar.gz
5+
RUN apt update \
6+
&& apt install -y ca-certificates \
7+
&& tar -xvf chisel.tar.gz -C /usr/bin/ \
8+
&& mkdir rootfs \
9+
&& install -d -m 0755 -o 33 -g 33 rootfs/var/www
10+
RUN chisel cut --release ubuntu-23.10 --root $PWD/rootfs \
11+
base-files_var \
12+
base-passwd_data \
13+
nginx_bins \
14+
nginx-common_index
15+
RUN rm -rf /opt/rootfs/etc/nginx/nginx.conf
16+
17+
FROM scratch
18+
COPY --from=builder /opt/rootfs /
19+
COPY nginx /etc/nginx
20+
EXPOSE 80
21+
CMD ["nginx", "-g", "daemon off;"]

nginx/conf.d/default.conf

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
server {
2+
server_tokens off;
3+
listen 80;
4+
location / {
5+
expires 1M;
6+
add_header Cache-Control private;
7+
root /usr/share/nginx/html;
8+
index index.html index.htm;
9+
try_files $uri $uri/ /index.html;
10+
}
11+
error_page 500 502 503 504 /50x.html;
12+
location = /50x.html {
13+
root /usr/share/nginx/html;
14+
}
15+
}

nginx/nginx.conf

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
user www-data;
2+
worker_processes auto;
3+
pid /run/nginx.pid;
4+
error_log /var/log/nginx/error.log;
5+
include /etc/nginx/modules-enabled/*.conf;
6+
7+
events {
8+
worker_connections 768;
9+
}
10+
11+
http {
12+
sendfile on;
13+
tcp_nopush on;
14+
types_hash_max_size 2048;
15+
include /etc/nginx/mime.types;
16+
default_type application/octet-stream;
17+
ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3;
18+
ssl_prefer_server_ciphers on;
19+
access_log /var/log/nginx/access.log;
20+
gzip on;
21+
include /etc/nginx/conf.d/*.conf;
22+
}

readme.md

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# nginx tiny
2+
13mb ARM container image to run frontend apps

0 commit comments

Comments
 (0)