initial docker setup

This commit is contained in:
2025-07-12 00:54:22 +02:00
parent 03c90491e8
commit 8e24bbd88a
3 changed files with 56 additions and 0 deletions

13
.dockerignore Normal file
View File

@@ -0,0 +1,13 @@
.gitignore
frontend/dist
frontend/.nuxt
frontend/.output
frontend/README.md
frontend/.prettierrc
frontend/.prettierignore
frontend/.gitignore
frontend/node_modules
backend/target
backend/.gitignore

29
Dockerfile Normal file
View File

@@ -0,0 +1,29 @@
FROM oven/bun:debian AS frontend-dependency-installer
WORKDIR /usr/src/warren
COPY frontend/package.json frontend/bun.lock ./
RUN bun install --frozen-lockfile --ignore-scripts
FROM node:bookworm AS frontend-builder
WORKDIR /usr/src/warren
COPY --from=frontend-dependency-installer /usr/src/warren/ .
COPY frontend/ ./
RUN npm run generate
FROM rust:bookworm AS backend-builder
WORKDIR /usr/src/warren
COPY backend/ .
RUN cargo build --release
FROM debian:bookworm
WORKDIR /var/lib/warren
COPY --from=backend-builder /usr/src/warren/target/release/warren /usr/bin/warren
COPY --from=frontend-builder /usr/src/warren/dist ./frontend
ENTRYPOINT ["warren"]

14
compose.yaml Normal file
View File

@@ -0,0 +1,14 @@
services:
warren:
image: 'warren:latest'
container_name: 'warren'
build: '.'
postgres:
image: 'postgres:17'
container_name: 'warren-db'
volumes:
- './postgres-data:/var/lib/postgresql/data'
environment:
- 'POSTGRES_PASSWORD=pg'
ports:
- '5432:5432/tcp'