-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
64 lines (35 loc) · 1.16 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
FROM alpine:3.20 as backend_builder
RUN apk add build-base rust cargo g++ zlib zlib-dev openssl-dev
WORKDIR /fosshack
COPY backend .
RUN cargo build --release
FROM alpine:3.20 as backend
RUN apk add openssl-dev
ENV ROCKET_ADDRESS="0.0.0.0"
ENV ROCKET_PORT=8000
WORKDIR /fosshack
COPY --from=backend_builder /fosshack/target/release/fosshack .
EXPOSE 8000
ENTRYPOINT "/fosshack/fosshack"
FROM node:20-alpine3.20 as frontend_builder
RUN apk add icu-libs icu-data-full
RUN npm install -g pnpm
WORKDIR /frontend
COPY frontend .
RUN pnpm install
RUN NITRO_PRESET=node-server pnpm run build
FROM node:20-alpine3.20 as frontend
WORKDIR /frontend
COPY --from=frontend_builder /frontend/.output .
EXPOSE 3000
ENTRYPOINT ["node", "/frontend/server/index.mjs"]
FROM node:20-alpine3.20 as aio
RUN apk add supervisor caddy icu-libs icu-data-full
WORKDIR /fosshack
COPY --from=backend_builder /fosshack/target/release/fosshack_backend backend
COPY --from=frontend_builder /frontend/.output frontend
COPY aio-supervisord.conf supervisord.conf
COPY Caddyfile Caddyfile
ENV ROCKET_PORT=8000
ENV ROCKET_ADDRESS="0.0.0.0"
CMD ["supervisord", "-c", "/fosshack/supervisord.conf"]