feat: dockerized project
This commit is contained in:
parent
069504da25
commit
e6bf8ffa68
|
@ -0,0 +1,3 @@
|
|||
dist
|
||||
target
|
||||
README.md
|
|
@ -0,0 +1,24 @@
|
|||
FROM rust:latest as build
|
||||
|
||||
# Install trunk
|
||||
RUN cargo install trunk
|
||||
|
||||
# Install wasm target
|
||||
RUN rustup target add wasm32-unknown-unknown
|
||||
|
||||
RUN mkdir -p /frontend
|
||||
WORKDIR /frontend
|
||||
|
||||
COPY Cargo.lock Cargo.toml index.html ./
|
||||
|
||||
COPY src ./src
|
||||
COPY style ./style
|
||||
|
||||
# Build for release.
|
||||
RUN trunk build --release
|
||||
|
||||
FROM nginx:latest
|
||||
|
||||
COPY ./nginx.conf /etc/nginx/conf.d/default.conf
|
||||
|
||||
COPY --from=build /frontend/dist /usr/share/nginx/html
|
|
@ -0,0 +1,8 @@
|
|||
server {
|
||||
listen 80;
|
||||
server_name 0.0.0.0;
|
||||
location / {
|
||||
root /usr/share/nginx/html;
|
||||
try_files $uri $uri/ /index.html;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue