Update Dockerfile
Browse files- Dockerfile +28 -9
Dockerfile
CHANGED
@@ -1,12 +1,31 @@
|
|
1 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
chmod +x /init
|
7 |
|
8 |
-
#
|
9 |
-
|
|
|
|
|
10 |
|
11 |
-
#
|
12 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# CGO_ENABLED=1 GOOS=linux CC=x86_64-unknown-linux-gnu-gcc CXX=x86_64-unknown-linux-gnu-g++ GOARCH=amd64 go build -ldflags "-X 'github.com/0xJacky/Nginx-UI/settings.buildTime=$(date +%s)'" -o nginx-ui -v main.go
|
2 |
+
FROM --platform=$TARGETPLATFORM uozi/nginx-ui-base:latest
|
3 |
+
ARG TARGETOS
|
4 |
+
ARG TARGETARCH
|
5 |
+
ARG TARGETVARIANT
|
6 |
+
WORKDIR /app
|
7 |
+
EXPOSE 80
|
8 |
|
9 |
+
COPY resources/demo/ojbk.me /etc/nginx/sites-available/ojbk.me
|
10 |
+
COPY resources/demo/app.ini /etc/nginx-ui/app.ini
|
11 |
+
COPY resources/demo/demo.db /etc/nginx-ui/database.db
|
|
|
12 |
|
13 |
+
# register nginx-ui service
|
14 |
+
COPY resources/docker/nginx-ui.run /etc/s6-overlay/s6-rc.d/nginx-ui/run
|
15 |
+
RUN echo 'longrun' > /etc/s6-overlay/s6-rc.d/nginx-ui/type && \
|
16 |
+
touch /etc/s6-overlay/s6-rc.d/user/contents.d/nginx-ui
|
17 |
|
18 |
+
# copy nginx config
|
19 |
+
COPY resources/docker/nginx.conf /etc/nginx/nginx.conf
|
20 |
+
COPY resources/docker/nginx-ui.conf /etc/nginx/conf.d/nginx-ui.conf
|
21 |
+
|
22 |
+
# copy nginx-ui executable binary
|
23 |
+
COPY nginx-ui-$TARGETOS-$TARGETARCH$TARGETVARIANT/nginx-ui /usr/local/bin/nginx-ui
|
24 |
+
|
25 |
+
RUN rm -f /etc/nginx/conf.d/default.conf
|
26 |
+
|
27 |
+
# recreate access.log and error.log
|
28 |
+
RUN rm -f /var/log/nginx/access.log && \
|
29 |
+
touch /var/log/nginx/access.log && \
|
30 |
+
rm -f /var/log/nginx/error.log && \
|
31 |
+
touch /var/log/nginx/error.log
|