ops: add docker support

This commit is contained in:
2025-03-11 18:53:26 +01:00
parent bbf83ef811
commit 134b89118f
4 changed files with 63 additions and 0 deletions

20
Dockerfile Normal file
View File

@ -0,0 +1,20 @@
FROM node:23-alpine AS frontend
WORKDIR /frontend
COPY frontend/package*.json /frontend
RUN npm ci
RUN npm i @tailwindcss/oxide-linux-x64-musl
COPY frontend/ /frontend
RUN npm run build
FROM golang:1.24-alpine AS backend
WORKDIR /backend
COPY backend/go.* /backend/
RUN go mod download
COPY backend/ /backend
COPY --from=frontend /frontend/dist/client/ /backend/public/
RUN go build -o HexDeck
FROM scratch
WORKDIR /app
COPY --from=backend /backend/HexDeck .
CMD ["/app/HexDeck"]

1
backend/.dockerignore Normal file
View File

@ -0,0 +1 @@
HexDeck

16
docker-compose.yml Normal file
View File

@ -0,0 +1,16 @@
services:
mongodb:
user: "1000"
volumes:
- ./data/mongodb/:/data/db/
image: mongodb/mongodb-community-server:latest
command: mongod --bind_ip_all
hexdeck:
user: "1000"
ports:
- 3000:3000
environment:
- MONGO_URI=mongodb://mongodb:27017/
depends_on:
- mongodb
build: .

26
frontend/.dockerignore Normal file
View File

@ -0,0 +1,26 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*
node_modules
dist
dist-ssr
*.local
.routify/*
# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?