Skip to content

Commit

Permalink
Merge pull request #171 from myyrakle/feat/#170
Browse files Browse the repository at this point in the history
[#170] Docker 예제 추가
  • Loading branch information
myyrakle authored Dec 8, 2024
2 parents df0210a + 2922d62 commit cbd77ca
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 5 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,6 @@ Cargo.lock

/target

test.json
test.json

.vscode
3 changes: 0 additions & 3 deletions .vscode/settings.json

This file was deleted.

3 changes: 2 additions & 1 deletion rupring_example/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@ edition = "2021"

[dependencies]
mockall = "0.13.1"
rupring={ path="../rupring" }
rupring={ version = "0.11.0" }
# rupring={ path="../rupring" }
serde = { version="1.0.193", features=["derive"] }
15 changes: 15 additions & 0 deletions rupring_example/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
FROM rust:1.83.0-alpine AS builder
COPY . /home/server
WORKDIR /home/server
# Do something for ready to build
RUN apk add musl-dev
RUN cargo build --release
RUN mv /home/server/target/release/rupring_example /home/server/bin

FROM alpine:3.21.0 AS deployer
RUN mkdir /app
COPY --from=builder /home/server/bin /app/server
COPY --from=builder /home/server/application.properties /app/application.properties
RUN ls -lah /app
ENTRYPOINT [ "/bin/sh", "-c", "/app/server" ]
EXPOSE 8080
21 changes: 21 additions & 0 deletions rupring_example/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Rupring Example

Simple example template

## Local Run

very easy

```bash
cargo run
```

## Docker

```bash
sudo docker build -t test .
sudo docker run -p 8080:8000 test
# ...

curl http://localhost:8080
```
7 changes: 7 additions & 0 deletions rupring_example/application.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
server.port=8080
server.shutdown=graceful
server.timeout-per-shutdown-phase=3s
server.compression.enabled=true
server.compression.mime-types=application/json,application/xml,text/html,text/xml,text/plain
server.compression.min-response-size=1024
server.compression.algorithm=gzip

0 comments on commit cbd77ca

Please sign in to comment.