-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile.dev
33 lines (22 loc) · 982 Bytes
/
Dockerfile.dev
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
FROM rust:1.70 as builder
WORKDIR /usr/src/portal
COPY . .
RUN set -x && \
NODEJS_VERSION=v16.17.0 && \
curl -O -L https://registry.npmmirror.com/-/binary/node/latest-v16.x/node-$NODEJS_VERSION-linux-x64.tar.gz && \
tar zxf node-$NODEJS_VERSION-linux-x64.tar.gz && \
rm node-$NODEJS_VERSION-linux-x64.tar.gz && \
mv node-$NODEJS_VERSION-linux-x64/ /nodejs && \
PATH=$PATH:/nodejs/bin && \
npm config set registry https://registry.npmmirror.com && \
npm i tailwindcss -g && \
# build client
cd /usr/src/portal/client && rustup target add wasm32-unknown-unknown && cargo install trunk --version 0.16.0 && trunk build --release
FROM nginx
WORKDIR /usr/src/client
COPY --from=builder /usr/src/portal/client/dist /usr/share/nginx/html/
RUN echo "Asia/Shanghai" > /etc/timezone
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
COPY client/nginx.dev.conf /etc/nginx/nginx.conf
EXPOSE 8080/tcp
CMD ["nginx", "-g", "daemon off;"]