feat: dockerized project

This commit is contained in:
antifallobst 2023-10-04 21:37:33 +02:00
parent 069504da25
commit e6bf8ffa68
Signed by: antifallobst
GPG Key ID: 2B4F402172791BAF
3 changed files with 35 additions and 0 deletions

3
.dockerignore Normal file
View File

@ -0,0 +1,3 @@
dist
target
README.md

24
Dockerfile Normal file
View File

@ -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

8
nginx.conf Normal file
View File

@ -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;
}
}