Merge branch 'feature/docker' into develop
This commit is contained in:
2
.env.sample
Normal file
2
.env.sample
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
ACCUWHEATHER_API_ID=########
|
||||||
|
PATH_TO_CITIES="/share/cities.json"
|
11
Dockerfile
Normal file
11
Dockerfile
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
FROM rust AS build
|
||||||
|
WORKDIR /code
|
||||||
|
COPY ./code .
|
||||||
|
RUN cargo install --path .
|
||||||
|
|
||||||
|
FROM debian:buster-slim
|
||||||
|
COPY --from=build /usr/local/cargo/bin/clima /usr/local/bin/clima
|
||||||
|
RUN apt-get update && apt-get install -y libssl-dev && rm -rf /var/lib/apt/lists/*
|
||||||
|
ENV ACCUWHEATHER_API_ID "1"
|
||||||
|
ENV PATH_TO_CITIES "/share/cities.json"
|
||||||
|
CMD [ "sh", "-c", "/usr/local/bin/clima $ACCUWHEATHER_API_ID $PATH_TO_CITIES" ]
|
14
README.md
14
README.md
@ -1,5 +1,17 @@
|
|||||||
# Call
|
# Call
|
||||||
|
|
||||||
```
|
```
|
||||||
app ACCUWHEATHER_API_ID PATH_TO_CITIES.txt
|
docker compose up
|
||||||
|
```
|
||||||
|
|
||||||
|
# Compile / Build
|
||||||
|
|
||||||
|
```
|
||||||
|
docker compose build
|
||||||
|
```
|
||||||
|
|
||||||
|
# Rebuild
|
||||||
|
|
||||||
|
```
|
||||||
|
docker compose down --rmi all; docker compose build
|
||||||
```
|
```
|
||||||
|
10
docker-compose.yml
Normal file
10
docker-compose.yml
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
version: '3'
|
||||||
|
|
||||||
|
services:
|
||||||
|
app:
|
||||||
|
image: rust
|
||||||
|
build: .
|
||||||
|
env_file:
|
||||||
|
- .env
|
||||||
|
volumes:
|
||||||
|
- ./cities.json:/share/cities.json
|
Reference in New Issue
Block a user