chore: docker conf

This commit is contained in:
EETagent 2022-10-24 21:11:53 +02:00
parent 93512c0d34
commit af07e382e7
2 changed files with 50 additions and 0 deletions

12
Dockerfile Normal file
View file

@ -0,0 +1,12 @@
FROM rust:latest
ENV ROCKET_ADDRESS=0.0.0.0
ENV ROCKET_PORT=8000
WORKDIR /app
RUN cargo install cargo-watch
COPY ./ ./
RUN cargo build

38
docker-compose.yml Normal file
View file

@ -0,0 +1,38 @@
version: '3.8'
services:
backend:
build:
context: ./
depends_on:
- db
environment:
DATABASE_URL: postgres://postgres:postgres@db:5432/postgres
ports:
- "9000:8000"
command: sh -c "cargo watch -x run"
volumes:
- ./:/app
networks:
- db
adminer:
image: adminer:latest
depends_on:
- db
ports:
- 9002:8080
networks:
- db
db:
image: "postgres:15"
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: postgres
ports:
- "9001:5432"
networks:
- db
networks:
db: