Skip to content

Commit

Permalink
Test slim build
Browse files Browse the repository at this point in the history
  • Loading branch information
ystxn committed Mar 9, 2024
1 parent cf4de14 commit a5357f0
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 2 deletions.
20 changes: 18 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
FROM nginx:stable
RUN rm -rf /etc/nginx/conf.d
FROM ubuntu:mantic as builder
ARG CHISEL_VER=0.9.0
WORKDIR /opt
ADD https://github.com/canonical/chisel/releases/download/v${CHISEL_VER}/chisel_v${CHISEL_VER}_linux_arm64.tar.gz chisel.tar.gz
RUN apt update \
&& apt install -y ca-certificates \
&& tar -xvf chisel.tar.gz -C /usr/bin/ \
&& mkdir rootfs \
&& install -d -m 0755 -o 33 -g 33 rootfs/var/www
RUN chisel cut --release ubuntu-23.10 --root $PWD/rootfs \
base-files_var \
base-passwd_data \
nginx_bins \
nginx-common_index
RUN rm -rf /opt/rootfs/etc/nginx/nginx.conf

FROM scratch
COPY --from=builder /opt/rootfs /
COPY nginx /etc/nginx
COPY dist /usr/share/nginx/html
EXPOSE 80
Expand Down
22 changes: 22 additions & 0 deletions nginx/nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
user www-data;
worker_processes auto;
pid /run/nginx.pid;
error_log /var/log/nginx/error.log;
include /etc/nginx/modules-enabled/*.conf;

events {
worker_connections 768;
}

http {
sendfile on;
tcp_nopush on;
types_hash_max_size 2048;
include /etc/nginx/mime.types;
default_type application/octet-stream;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3;
ssl_prefer_server_ciphers on;
access_log /var/log/nginx/access.log;
gzip on;
include /etc/nginx/conf.d/*.conf;
}

0 comments on commit a5357f0

Please sign in to comment.