mirror of
https://github.com/Pagwin-Fedora/website.git
synced 2025-07-18 01:55:42 +00:00
some work done need to go to class now
This commit is contained in:
parent
92186c3a58
commit
5deea869e4
3 changed files with 40 additions and 2 deletions
15
Dockerfile
15
Dockerfile
|
@ -4,9 +4,20 @@ RUN ["apk", "update"]
|
|||
RUN ["apk", "add hugo"]
|
||||
ADD . /root/
|
||||
WORKDIR /root
|
||||
ARG WITH_COMMENTS=0
|
||||
# pass in the uri or ip of the comments api so nginx can forward to it
|
||||
ARG COMMENTS_BACKEND
|
||||
ENV COMMENTS_BACKEND=${WITH_BACKEND}
|
||||
RUN ["hugo", "--minify"]
|
||||
|
||||
FROM nginx:1.25
|
||||
FROM python:3.11-alpine as fiddling
|
||||
RUN ["adduser", "-h", "/application", "application"]
|
||||
# might need to chown these
|
||||
ADD ./scripts/template_convert.py /application/template_convert.py
|
||||
ADD ./nginx.conf.template /application/nginx.conf.template
|
||||
WORKDIR /application
|
||||
USER application
|
||||
RUN ["python", "/application/template_convert.py"]
|
||||
|
||||
FROM nginx:1.25
|
||||
COPY --from=fiddling /application/nginx.conf
|
||||
RUN
|
||||
|
|
27
nginx.conf.template
Normal file
27
nginx.conf.template
Normal file
|
@ -0,0 +1,27 @@
|
|||
worker_processes 1;
|
||||
|
||||
events {
|
||||
worker_connections 1024;
|
||||
}
|
||||
|
||||
http {
|
||||
include mime.types;
|
||||
default_type application/octet-stream;
|
||||
|
||||
sendfile on;
|
||||
keepalive_timeout 65;
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
server_name pagwin.xyz;
|
||||
location / {
|
||||
root /usr/share/nginx/html;
|
||||
index index.html index.htm;
|
||||
}
|
||||
# weird comments around this block is so we can easily yeet it if the comments backend isn't present
|
||||
###{---
|
||||
location /comments {
|
||||
# we're going to use a python program to substitute this out
|
||||
proxy_pass http://${{COMMENTS_BACKEND}}
|
||||
}
|
||||
}
|
0
scripts/template_convert.py
Normal file
0
scripts/template_convert.py
Normal file
Loading…
Reference in a new issue