diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..4e1cc60 --- /dev/null +++ b/Dockerfile @@ -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"] \ No newline at end of file diff --git a/backend/.dockerignore b/backend/.dockerignore new file mode 100644 index 0000000..3320515 --- /dev/null +++ b/backend/.dockerignore @@ -0,0 +1 @@ +HexDeck \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..87d4a22 --- /dev/null +++ b/docker-compose.yml @@ -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: . \ No newline at end of file diff --git a/frontend/.dockerignore b/frontend/.dockerignore new file mode 100644 index 0000000..f4bbd82 --- /dev/null +++ b/frontend/.dockerignore @@ -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? \ No newline at end of file