Skip to content

Instantly share code, notes, and snippets.

@vcapra1
Last active January 25, 2019 16:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vcapra1/0a857aac8f05277e65ea5d86e8e4e239 to your computer and use it in GitHub Desktop.
Save vcapra1/0a857aac8f05277e65ea5d86e8e4e239 to your computer and use it in GitHub Desktop.
Files for SO Q#54369113
[package]
name = "my-app"
version = "0.1.0"
authors = ["vinnie <vcapra1@gmail.com>"]
edition = "2018"
[dependencies]
rocket = "0.4.0"
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"]
#![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();
}
ROCKET_PORT=$PORT ROCKET_ENV=prod ./target/release/my-app
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment