added docker support

This commit is contained in:
Denys Konovalov 2021-12-17 11:31:46 +01:00
parent 813a9c80db
commit b65c4e306d
3 changed files with 24 additions and 2 deletions

10
Dockerfile Normal file

@ -0,0 +1,10 @@
FROM rust:1 as builder
WORKDIR /app
COPY . .
RUN cargo install --path .
FROM debian:buster-slim as runner
COPY --from=builder /usr/local/cargo/bin/api /usr/local/bin/api
ENV ROCKET_ADDRESS=0.0.0.0
EXPOSE 3000
CMD ["api"]

@ -7,5 +7,17 @@ services:
POSTGRES_PASSWORD: meincantor_password POSTGRES_PASSWORD: meincantor_password
POSTGRES_USER: meincantor POSTGRES_USER: meincantor
POSTGRES_DB: meincantor_db POSTGRES_DB: meincantor_db
ports: expose: '5432'
- "5432:5432" api:
image: lxdb/meincantor-api
restart: always
environment:
IW_TIMETABLE_URL: https://stundenplan24.de/EXAMPLE_SCHOOL/mobil/mobdaten
IW_TIMETABLE_USER: EXAMPLE_USER
IW_TIMETABLE_PASSWORD: EXAMPLE_PASSWORD
JWT_SECRET: EXAMPLE_SECRET
JWT_ISSUER: Georg-Cantor-Gymnasium Halle(Saale)
KC_OPENID_TOKEN_ENDPOINT: https://example.keycloak.com/auth/realms/EXAMPLE_REALM/protocol/openid-connect/token
KC_OPENID_USERINFO_ENDPOINT: https://example.keycloak.com/auth/realms/EXAMPLE_REALM/protocol/openid-connect/userinfo
KC_CLIENT_ID: EXAMPLE_CLIENT
ROCKET_DATABASES: '{timetable={url="postgres://meincantor:meincantor_password@postgres/meincantor_db"}}''

0
static/.gitkeep Normal file