diff --git a/.gitignore b/.gitignore index 3ca43ae..c64073f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ + # ---> Rust # Generated by Cargo # will have compiled files and executables @@ -14,3 +15,5 @@ Cargo.lock # MSVC Windows builds of rustc generate these, which store debugging information *.pdb +.vscode +.idea diff --git a/Cargo.lock b/Cargo.lock new file mode 100644 index 0000000..5512a87 --- /dev/null +++ b/Cargo.lock @@ -0,0 +1,7 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "crts" +version = "0.1.0" diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 0000000..86e4089 --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "crts" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..36f7329 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,12 @@ +FROM rust:latest + +WORKDIR /app/ + +COPY . . + +ENV CARGO_HTTP_MULTIPLEXING=false + +RUN cargo install diesel_cli --no-default-features --features "postgres" +RUN cargo install cargo-watch + +CMD ["cargo", "watch", "--why", "-x", "build"] \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..7ccd8d4 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,21 @@ +version: '3.3' + +services: + postgres: + image: postgres:latest + environment: + - POSTGRES_USER=postgres + - POSTGRES_PASSWORD=postgres + - POSTGRES_DB=app_db + command: ["postgres", "-c", "log_statement=all"] + redis: + image: redis:latest + + app: + build: . + environment: + - DATABASE_URL=postgres://postgres:postgres@postgres/app_db + ports: + - "8123:8000" + volumes: + - ./:/app/ \ No newline at end of file diff --git a/src/main.rs b/src/main.rs new file mode 100644 index 0000000..e7a11a9 --- /dev/null +++ b/src/main.rs @@ -0,0 +1,3 @@ +fn main() { + println!("Hello, world!"); +}