Add Docker support (#1)
This commit is contained in:
parent
23f0c99540
commit
e6438cee08
4 changed files with 35 additions and 1 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -1,3 +1,5 @@
|
|||
/target
|
||||
/config
|
||||
/dist
|
||||
|
||||
docker-compose.yml
|
||||
|
|
18
Dockerfile
Normal file
18
Dockerfile
Normal file
|
@ -0,0 +1,18 @@
|
|||
# syntax=docker/dockerfile:1
|
||||
|
||||
FROM rust:1.67 AS builder
|
||||
WORKDIR /usr/src/ewp
|
||||
COPY . .
|
||||
|
||||
RUN cargo install --path .
|
||||
|
||||
|
||||
FROM debian:bullseye-slim
|
||||
RUN mkdir /app
|
||||
WORKDIR /app
|
||||
|
||||
COPY --from=builder /usr/local/cargo/bin/ewp /app/ewp
|
||||
COPY --from=builder /usr/src/ewp/LICENSE /app/LICENSE
|
||||
COPY --from=builder /usr/src/ewp/static /app/static
|
||||
|
||||
CMD [ "./ewp" ]
|
14
README.md
14
README.md
|
@ -5,3 +5,17 @@ Easy WebPage generator
|
|||
[![dependency status](https://deps.rs/repo/gitea/git.mylloon.fr/Anri/mylloon.fr/status.svg)](https://deps.rs/repo/gitea/git.mylloon.fr/Anri/mylloon.fr)
|
||||
|
||||
See [issues](https://git.mylloon.fr/Anri/mylloon.fr/issues)
|
||||
|
||||
## Use Docker Compose
|
||||
|
||||
```yaml
|
||||
version: "3.9"
|
||||
|
||||
services:
|
||||
ewp:
|
||||
build: .
|
||||
container_name: EWP
|
||||
ports:
|
||||
- 80:8080
|
||||
restart: unless-stopped
|
||||
```
|
||||
|
|
|
@ -30,7 +30,7 @@ mod portfolio;
|
|||
async fn main() -> io::Result<()> {
|
||||
let config = config::get_config("./config/config.toml");
|
||||
|
||||
let addr = ("127.0.0.1", config.port.unwrap());
|
||||
let addr = ("0.0.0.0", config.port.unwrap());
|
||||
|
||||
println!(
|
||||
"Listening to {}://{}:{}",
|
||||
|
|
Loading…
Reference in a new issue