Gusti Adli Anshari commited on
Commit
e854175
·
2 Parent(s): 116ecff 28acf4a

Merge branch 'dockerfile/one-stage-build' of github.com:gstdl/rust-docker-demo-counter-api into dockerfile/multi-stage-build

Browse files
Files changed (2) hide show
  1. .dockerignore +3 -1
  2. Dockerfile +6 -3
.dockerignore CHANGED
@@ -14,5 +14,7 @@ Cargo.lock
14
  *.pdb
15
 
16
  .vscode
 
 
17
 
18
- config.yaml
 
14
  *.pdb
15
 
16
  .vscode
17
+ .gitignore
18
+ README.md
19
 
20
+ config.yaml
Dockerfile CHANGED
@@ -1,9 +1,12 @@
1
- FROM rust:1.77.2-alpine3.18 AS builder
2
-
 
3
  WORKDIR /app
 
4
  COPY . .
5
-
6
  RUN apk add --no-cache musl-dev
 
7
  RUN cargo install --path .
8
 
9
  # FROM alpine:3.18
 
1
+ # Base image
2
+ FROM rust:1.77.2-alpine3.18
3
+ # Working directory
4
  WORKDIR /app
5
+ # Copy application code and dependencies
6
  COPY . .
7
+ # Install OS dependencies
8
  RUN apk add --no-cache musl-dev
9
+ # Build the application
10
  RUN cargo install --path .
11
 
12
  # FROM alpine:3.18