Make a Dockerfile to enable running the app in a container.
This commit is contained in:
parent
a9f0964452
commit
2cbb54c483
20
Dockerfile
Normal file
20
Dockerfile
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
FROM rust:alpine
|
||||||
|
|
||||||
|
WORKDIR /usr/src/app
|
||||||
|
|
||||||
|
RUN apk add git musl-dev npm && \
|
||||||
|
npm install tailwindcss
|
||||||
|
|
||||||
|
COPY build.rs .
|
||||||
|
COPY Cargo.lock .
|
||||||
|
COPY Cargo.toml .
|
||||||
|
COPY public/ public/
|
||||||
|
COPY Rocket.toml .
|
||||||
|
COPY src/ src/
|
||||||
|
COPY tailwind.config.js .
|
||||||
|
COPY templates/ templates/
|
||||||
|
|
||||||
|
RUN mkdir target
|
||||||
|
RUN cargo install --config "net.git-fetch-with-cli=true" --path .
|
||||||
|
|
||||||
|
CMD ["rust-letter"]
|
33
Rocket.toml
Normal file
33
Rocket.toml
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
[default]
|
||||||
|
address = "0.0.0.0"
|
||||||
|
# workers = 16
|
||||||
|
# max_blocking = 512
|
||||||
|
# keep_alive = 5
|
||||||
|
ident = "rust-letter-werefox-cafe"
|
||||||
|
# ip_header = "X-Real-IP" # set to `false` to disable
|
||||||
|
# log_level = "normal"
|
||||||
|
# temp_dir = "/tmp"
|
||||||
|
# cli_colors = true
|
||||||
|
|
||||||
|
[debug]
|
||||||
|
port = 8234
|
||||||
|
|
||||||
|
[release]
|
||||||
|
port = 3469
|
||||||
|
secret_key = "yqXUwxWOGD6X7yZaMbRnOXsNjiDMicveyC2imK48KbM="
|
||||||
|
|
||||||
|
# [default.limits]
|
||||||
|
# form = "64 kB"
|
||||||
|
# json = "1 MiB"
|
||||||
|
# msgpack = "2 MiB"
|
||||||
|
# "file/jpg" = "5 MiB"
|
||||||
|
|
||||||
|
# [default.tls]
|
||||||
|
# certs = "path/to/cert-chain.pem"
|
||||||
|
# key = "path/to/key.pem"
|
||||||
|
|
||||||
|
# [default.shutdown]
|
||||||
|
# ctrlc = true
|
||||||
|
# signals = ["term", "hup"]
|
||||||
|
# grace = 5
|
||||||
|
# mercy = 5
|
7
build.rs
7
build.rs
@ -1,12 +1,5 @@
|
|||||||
fn main() {
|
fn main() {
|
||||||
let mut tailwind = std::process::Command::new("npx");
|
let mut tailwind = std::process::Command::new("npx");
|
||||||
// tailwind.args([
|
|
||||||
// "-c",
|
|
||||||
// "tailwind.config.js",
|
|
||||||
// "-o",
|
|
||||||
// "src/index.css",
|
|
||||||
// "--minify",
|
|
||||||
// ]);
|
|
||||||
tailwind.args(
|
tailwind.args(
|
||||||
"tailwindcss -i src/index.css -c tailwind.config.js -o public/styles/tailwind.min.css --minify"
|
"tailwindcss -i src/index.css -c tailwind.config.js -o public/styles/tailwind.min.css --minify"
|
||||||
.split(" "),
|
.split(" "),
|
||||||
|
10
docker-compose.yml
Normal file
10
docker-compose.yml
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
---
|
||||||
|
version: "3"
|
||||||
|
|
||||||
|
services:
|
||||||
|
"rust-letter-werefox-cafe":
|
||||||
|
image: rust-letter-werefox-cafe:latest
|
||||||
|
build:
|
||||||
|
context: .
|
||||||
|
ports:
|
||||||
|
- "3469:3469"
|
Loading…
Reference in New Issue
Block a user