File tree 3 files changed +50
-0
lines changed
3 files changed +50
-0
lines changed Original file line number Diff line number Diff line change
1
+ ** /target
Original file line number Diff line number Diff line change
1
+ FROM rust:1.69-buster as builder
2
+
3
+ WORKDIR /app
4
+
5
+ ARG DB_URL
6
+
7
+ ENV DB_URL=$DB_URL
8
+
9
+ COPY . .
10
+
11
+ RUN cargo build --release
12
+
13
+
14
+ FROM debian:buster-slim
15
+
16
+ WORKDIR /usr/local/bin
17
+
18
+ COPY --from=builder /app/target/release/rust-crud-api .
19
+
20
+ CMD ["./rust-crud-api" ]
Original file line number Diff line number Diff line change
1
+ version : ' 3.9'
2
+
3
+ services :
4
+
5
+ app :
6
+ image : rustapp:latest
7
+ build :
8
+ context : .
9
+ dockerfile : Dockerfile
10
+ args :
11
+ DB_URL : postgres://postgres:postgres@db:5432/postgres
12
+ ports :
13
+ - ' 8080:8080'
14
+ depends_on :
15
+ - db
16
+
17
+ db :
18
+ image : postgres:12
19
+ environment :
20
+ POSTGRES_USER : postgres
21
+ POSTGRES_PASSWORD : postgres
22
+ POSTGRES_DB : postgres
23
+ ports :
24
+ - ' 5432:5432'
25
+ volumes :
26
+ - pgdata:/var/lib/postgresql/data
27
+
28
+ volumes :
29
+ pgdata : {}
You can’t perform that action at this time.
0 commit comments