Merge pull request #7 from EETagent/docker_dev

Docker
This commit is contained in:
Sebastian Pravda 2022-10-26 15:17:19 +02:00 committed by GitHub
commit 162eed786d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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: