Compare commits
4 Commits
918992702f
...
84d93d496a
| Author | SHA1 | Date | |
|---|---|---|---|
| 84d93d496a | |||
| 4a9d252691 | |||
| 3c9a9a7d9d | |||
| 010cbd6d4b |
15
Dockerfile
15
Dockerfile
@@ -1,22 +1,11 @@
|
||||
FROM rust:1.89 AS builder
|
||||
|
||||
RUN apt-get update
|
||||
RUN apt-get install -y --no-install-recommends libasound2-dev libudev-dev
|
||||
RUN rustup target add wasm32-unknown-unknown
|
||||
RUN cargo install --locked wasm-bindgen-cli
|
||||
|
||||
# Copy in only the parts we care about. This is to prevent Docker from re-
|
||||
# running some steps because unimportant files changed (e.g.: the .git/ folder)
|
||||
COPY src/ ./src
|
||||
COPY Cargo.toml ./Cargo.toml
|
||||
# WARN: The lockfile doesn't exist in the repo. You will have to create it
|
||||
# before building the Docker image (i.e.: run `cargo update` first)
|
||||
COPY Cargo.lock ./Cargo.lock
|
||||
COPY www/ ./www
|
||||
COPY Makefile ./Makefile
|
||||
COPY . .
|
||||
|
||||
# Oops. There's no text output in the Docker build command line (it still works, though)
|
||||
RUN make
|
||||
RUN make -j
|
||||
|
||||
FROM busybox:musl
|
||||
RUN mkdir -p /var/www
|
||||
|
||||
8
Makefile
8
Makefile
@@ -61,3 +61,11 @@ clean:
|
||||
# this, I guess.
|
||||
full-clean: clean
|
||||
cargo clean
|
||||
|
||||
# Installation goal. It's meant to be a helper utility for moving the built
|
||||
# output into the web root. Only supports the "bundle-able" mode.
|
||||
install: web
|
||||
install -dm0755 $(DESTDIR)
|
||||
install -m0644 out/asteroids.js $(DESTDIR)/
|
||||
install -m0644 out/asteroids_bg.wasm $(DESTDIR)/
|
||||
install -m0644 out/asteroids.html $(DESTDIR)/
|
||||
|
||||
@@ -2,15 +2,25 @@
|
||||
<html lang="en">
|
||||
<head>
|
||||
<style>
|
||||
body {
|
||||
background-color: hsl(200, 3%, 65%);
|
||||
}
|
||||
h1 {
|
||||
color: hsl(200, 3%, 90%);
|
||||
background-color: hsl(195, 5%, 17%);
|
||||
text-align: center;
|
||||
margin: auto;
|
||||
padding: 0.5em;
|
||||
}
|
||||
canvas {
|
||||
padding-left: 0;
|
||||
padding-right: 0;
|
||||
margin-top: 1em;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
display: block;
|
||||
outline-color: hsl(200, 7%, 50%);
|
||||
outline-style: outset;
|
||||
border-radius: 8px;
|
||||
background-color: rgb(40%, 40%, 40%);
|
||||
}
|
||||
main {
|
||||
margin-left: auto;
|
||||
@@ -18,11 +28,12 @@
|
||||
width: 70%;
|
||||
}
|
||||
table {
|
||||
margin-bottom: 10px;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
th, td {
|
||||
border: 1px solid;
|
||||
padding: 2px 4px;
|
||||
padding: 0.1em 0.3em;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
Reference in New Issue
Block a user