Skip to content

Commit 0d3bebd

Browse files
committed
Merging @Gepardgame Dockerfile+nginx conf
1 parent f73ee6c commit 0d3bebd

File tree

2 files changed

+39
-0
lines changed

2 files changed

+39
-0
lines changed

Dockerfile

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
FROM alpine:latest AS builder
2+
3+
ENV OWNER=rb-x
4+
ENV REPO=penflow
5+
ENV API_URL="https://api.github.com/repos/$OWNER/$REPO/releases/latest"
6+
7+
WORKDIR /root
8+
RUN apk update && apk add --no-cache curl jq unzip
9+
RUN LATEST_RELEASE=$(curl -s "$API_URL" | jq -r '.tag_name') && \
10+
curl -LO "https://github.com/$OWNER/$REPO/releases/download/$LATEST_RELEASE/penflow-free-$LATEST_RELEASE.zip" && \
11+
unzip -q "penflow-free-$LATEST_RELEASE.zip"
12+
13+
# serve site with nginx
14+
FROM nginx:alpine
15+
16+
# copy files
17+
WORKDIR /home/webserver
18+
COPY ./nginx.conf /etc/nginx/
19+
COPY --from=builder /root/dist /home/webserver/penflow
20+
21+
# expose and run
22+
EXPOSE 80

nginx.conf

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
events {}
2+
3+
http {
4+
include mime.types;
5+
default_type application/octet-stream;
6+
7+
server {
8+
listen 80;
9+
server_name localhost;
10+
11+
root /home/webserver/penflow/;
12+
13+
location / {
14+
try_files $uri $uri/ /index.html;
15+
}
16+
}
17+
}

0 commit comments

Comments
 (0)