-
-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathDockerfile
54 lines (36 loc) · 933 Bytes
/
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
# Rust stuff
FROM rust:1.63-buster AS rust_build
WORKDIR /build
COPY ftml/Cargo.lock .
COPY ftml/Cargo.toml .
RUN mkdir src
RUN touch src/lib.rs
RUN cargo build --release
COPY ftml .
RUN cargo build --release
# JS stuff
FROM node:17 as js_build
RUN mkdir -p /build/static
WORKDIR /build/web/js
COPY web/js .
RUN yarn install
RUN yarn run build
WORKDIR /build/system/js
COPY system/js .
RUN yarn install
RUN yarn run build
# Python stuff
FROM python:3.12.7
WORKDIR /app
COPY requirements.txt .
RUN python -m pip install -r requirements.txt
RUN python -m pip install gunicorn
COPY . .
COPY --from=js_build /build/static/* ./static/
COPY --from=rust_build /build/target/release/libftml.so ./ftml/ftml.so
RUN useradd -u 8877 scpwiki
RUN chown scpwiki:scpwiki /app -R
USER scpwiki
RUN python manage.py collectstatic
EXPOSE 8000
CMD ["gunicorn", "scpdev.wsgi", "-w", "32", "-t", "300", "-b", "0.0.0.0:8000", "--preload"]