Skip to content

Commit

Permalink
chore: add docker configuration
Browse files Browse the repository at this point in the history
Add Dockerfile and docker compose example
  • Loading branch information
Data5tream committed Apr 18, 2023
1 parent 1c5cb82 commit af3cd58
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
target
config*.toml
Dockerfile
docker-compose.yml
README.md
*.log
22 changes: 22 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
FROM node:19.9 AS frontend

WORKDIR /frontend
RUN npm install -g pnpm
COPY frontend .
RUN pnpm i
ENV NODE_ENV=production
RUN pnpm run build

FROM rust:1.68 AS backend
WORKDIR /usr/src/status-page
COPY ["Cargo.lock", "Cargo.toml", "./"]
RUN cargo
COPY src src/
RUN cargo install --path .

FROM debian:bullseye-slim
RUN apt-get update && apt-get install -y ca-certificates && rm -rf /var/lib/apt/lists/*
COPY --from=backend /usr/local/cargo/bin/simple-status-page app
COPY --from=frontend /frontend/build web

CMD ["./app"]
17 changes: 17 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
services:
redis:
image: redis:alpine
networks:
- backend
app:
image: ghcr.io/data5tream/status-page-test:latest
ports:
- 8080:8080
networks:
- default
- backend
volumes:
- ./config.toml:/config.toml
networks:
default:
backend:
4 changes: 4 additions & 0 deletions frontend/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.idea
.svelte-kit
.build
.node_modules

0 comments on commit af3cd58

Please sign in to comment.