Last active
January 25, 2019 16:45
-
-
Save vcapra1/0a857aac8f05277e65ea5d86e8e4e239 to your computer and use it in GitHub Desktop.
Files for SO Q#54369113
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[package] | |
name = "my-app" | |
version = "0.1.0" | |
authors = ["vinnie <vcapra1@gmail.com>"] | |
edition = "2018" | |
[dependencies] | |
rocket = "0.4.0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM rust:1.31 | |
RUN USER=root cargo new --bin my-app | |
WORKDIR /my-app | |
COPY ./Cargo.lock ./Cargo.lock | |
COPY ./Cargo.toml ./Cargo.toml | |
COPY ./rust-toolchain ./rust-toolchain | |
COPY ./run ./run | |
RUN cargo build --release | |
RUN rm src/*.rs | |
COPY ./src ./src | |
RUN rm ./target/release/deps/my-app* | |
RUN cargo build --release | |
CMD ["./run"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#![feature(proc_macro_hygiene, decl_macro)] | |
#[macro_use] extern crate rocket; | |
use std::fs; | |
#[get("/")] | |
fn index() -> &'static str { | |
"Hello from Rust!" | |
} | |
fn main() { | |
rocket::ignite().mount("/", routes![index]).launch(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ROCKET_PORT=$PORT ROCKET_ENV=prod ./target/release/my-app |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
nightly |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment