-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
36 lines (27 loc) · 1.03 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
# Start from the official Rust image
FROM rust:latest as builder
# Install musl-tools
RUN apt-get update && apt-get install -y musl-tools && rm -rf /var/lib/apt/lists/*
# Target the wasm32-unknown-unknown target
RUN rustup target add wasm32-unknown-unknown
# Set the working directory
WORKDIR /app
# Add labels for OCI annotations
LABEL org.opencontainers.image.source="https://github.com/storopoli/sudoku" \
org.opencontainers.image.description="Sudoku" \
org.opencontainers.image.licenses="MIT"
# Install diouxus-cli
RUN cargo install dioxus-cli --locked
# Copy project's root dir
COPY . .
# COPY the docker specific files to Dioxus
COPY Dioxus_docker.toml Dioxus.toml
COPY assets/manifest_docker.json assets/manifest.json
# Build the application
RUN dx build --release --verbose
# Start a new stage from a slim version of Debian to reduce the size of the final image
FROM nginx:alpine
# Copy the dist/ from the builder stage to the new stage
COPY --from=builder /app/dist /dist
WORKDIR /dist
COPY ./nginx.conf /etc/nginx/nginx.conf