🎉 Initial docker boilerplate for the crts app
parent
856c6c52e1
commit
893eefb16a
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
@ -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]
|
||||
|
|
@ -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"]
|
||||
|
|
@ -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/
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
fn main() {
|
||||
println!("Hello, world!");
|
||||
}
|
||||
Loading…
Reference in New Issue