Skip to content

Commit 913aad6

Browse files
committed
feat(frontend): incident pages
1 parent 1406cc2 commit 913aad6

22 files changed

Lines changed: 596 additions & 208 deletions

.github/workflows/images.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
with:
4242
context: .
4343
push: true
44-
target: caddy
44+
target: frontend
4545
tags: ${{ steps.meta_frontend.outputs.tags }}
4646
labels: ${{ steps.meta_frontend.outputs.labels }}
4747

Caddyfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# example caddyfile
2-
:80 {
3-
file_server /* {
4-
root /srv
2+
:5080 {
3+
reverse_proxy /* {
4+
to frontend:3000
55
}
66
reverse_proxy /api/* {
77
to backend:8080

Dockerfile

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,37 @@
11
FROM alpine:latest AS build
22

3-
RUN apk add nodejs npm go git make
3+
RUN apk add go make
44

55
COPY backend/ /build/backend/
6-
COPY frontend/ /build/frontend/
76
COPY Makefile /build/
8-
COPY .git/ /build/.git
97

108
WORKDIR /build
11-
RUN make
9+
RUN make backend
10+
11+
12+
FROM node:20-alpine AS build-sveltekit
13+
WORKDIR /app
14+
15+
COPY frontend/package*.json ./
16+
RUN npm install
17+
18+
COPY frontend .
19+
RUN npm run build
20+
21+
22+
FROM node:20-alpine AS frontend
23+
WORKDIR /app
24+
25+
COPY --from=build-sveltekit /app/package*.json ./
26+
RUN npm install --omit=dev
27+
28+
COPY --from=build-sveltekit /app/build ./build
29+
COPY --from=build-sveltekit /app/static ./static
30+
EXPOSE 3000
31+
ENV NODE_ENV=production
32+
CMD ["node", "./build/index.js"]
1233

13-
FROM caddy:2.10 AS caddy
14-
COPY Caddyfile /etc/caddy/Caddyfile
15-
COPY --from=build /build/build/srv /srv
1634

1735
FROM alpine:latest AS backend
1836
COPY --from=build /build/build /app/
19-
ENTRYPOINT [ "/app/status" ]
37+
ENTRYPOINT [ "/app/status" ]

Makefile

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,4 @@ clean:
1717
.PHONY: dev
1818
dev: backend
1919
export $(xargs < .env)
20-
rm -rf build/srv/* && mkdir -p build build/srv
21-
cd frontend && npm install && npm run build && mv -f build/* ../build/srv
22-
cd build && pluralkit__status__run_dev=true ./status
20+
cd build && pluralkit__status__addr="0.0.0.0:5000" ./status & cd frontend && BACKEND_URL="http://localhost:5000" npm run dev

docker-compose.yml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,22 @@ services:
1212
- pluralkit__status__db_location=file:/app/data/status.db
1313
restart: unless-stopped
1414

15-
caddy:
15+
frontend:
1616
build:
1717
context: .
18-
target: caddy
18+
target: frontend
19+
environment:
20+
- BACKEND_URL=http://backend:8080
21+
restart: unless-stopped
22+
23+
caddy:
24+
image: caddy:latest
25+
volumes:
26+
- ./Caddyfile:/etc/caddy/Caddyfile
1927
cap_add:
2028
- NET_ADMIN
2129
ports:
22-
- "80:80"
23-
- "443:443"
24-
- "443:443/udp"
30+
- "5080:5080"
2531

2632
volumes:
2733
data:

0 commit comments

Comments
 (0)