mirror of
https://github.com/HexCardGames/HexDeck.git
synced 2025-09-03 10:38:40 +02:00
ops: add docker support
This commit is contained in:
20
Dockerfile
Normal file
20
Dockerfile
Normal 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
1
backend/.dockerignore
Normal file
@ -0,0 +1 @@
|
||||
HexDeck
|
16
docker-compose.yml
Normal file
16
docker-compose.yml
Normal 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
26
frontend/.dockerignore
Normal 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?
|
Reference in New Issue
Block a user