-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathDockerfile
42 lines (32 loc) · 1.23 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
FROM node:14
# install tooling
RUN apt-get update \
&& apt-get install -y curl make \
&& rm -rf /var/lib/apt/lists/*
# install rust
ENV RUSTUP_HOME=/usr/local/rustup \
CARGO_HOME=/usr/local/cargo \
PATH=/usr/local/cargo/bin:$PATH
RUN apt-get update \
&& apt-get install -y --no-install-recommends ca-certificates gcc libc6-dev \
&& curl -L --output rustup-init "https://static.rust-lang.org/rustup/dist/x86_64-unknown-linux-gnu/rustup-init" \
&& chmod +x rustup-init \
&& ./rustup-init -y --no-modify-path --default-toolchain nightly \
&& rm rustup-init \
&& chmod -R a+w $RUSTUP_HOME $CARGO_HOME \
&& rustup --version \
&& cargo --version \
&& rustc --version \
&& rm -rf /var/lib/apt/lists/*
# install wasm-pack v0.8.1
RUN curl -L --output wasm-pack-init https://rustwasm.github.io/wasm-pack/installer/init.sh \
&& chmod +x wasm-pack-init \
&& sed -i -e "s~UPDATE_ROOT=\".*\"~UPDATE_ROOT=\"https://github.com/rustwasm/wasm-pack/releases/download/v0.8.1\"~g" wasm-pack-init \
&& sed -i -e "s~wasm-pack-v.*-~wasm-pack-v0.8.1-~g" wasm-pack-init \
&& ./wasm-pack-init \
&& rm wasm-pack-init
WORKDIR /usr/front
COPY . .
RUN npm ci
RUN npm run build
CMD npm run serve-prod