mirror of
https://github.com/danbulant/Portfolio
synced 2026-07-05 11:00:56 +00:00
chore: docker conf
This commit is contained in:
parent
93512c0d34
commit
af07e382e7
2 changed files with 50 additions and 0 deletions
12
Dockerfile
Normal file
12
Dockerfile
Normal 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
38
docker-compose.yml
Normal 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:
|
||||||
Loading…
Reference in a new issue