fix up some docker build issues re pathing

This commit is contained in:
iamBadgers
2025-06-07 23:55:37 -07:00
parent a3ecb70abe
commit 2d81203398
7 changed files with 21 additions and 24 deletions

4
.dockerignore Normal file
View File

@@ -0,0 +1,4 @@
dist
rush-character-archive/node_modules
vault/node_modules
vault/src/proto

View File

@@ -3,7 +3,9 @@ networks:
services: services:
rush-character-archive: rush-character-archive:
build: ./rush-character-archive build:
context: ./
dockerfile: ./rush-character-archive/Dockerfile
command: npm run dev command: npm run dev
networks: networks:
- rush-character-net - rush-character-net
@@ -21,7 +23,9 @@ services:
- action: rebuild - action: rebuild
path: ./rush-character-archive/Dockerfile path: ./rush-character-archive/Dockerfile
vault: vault:
build: ./vault build:
context: ./
dockerfile: ./vault/Dockerfile
command: npm run dev command: npm run dev
networks: networks:
- rush-character-net - rush-character-net

View File

@@ -2,13 +2,13 @@ FROM node:22.16
WORKDIR /srv/rush-character-archive WORKDIR /srv/rush-character-archive
COPY package.json . COPY rush-character-archive/package.json .
RUN npm install RUN npm install
RUN npm i -g serve RUN npm i -g serve
COPY . . COPY rush-character-archive/. .
RUN npm run build RUN npm run build

View File

@@ -13,7 +13,6 @@ RUN npm install
COPY vault . COPY vault .
RUN npm install -g protoc RUN npm install -g protoc
RUN npm install -g protoc-gen-js
RUN npm install -g protoc-gen-ts RUN npm install -g protoc-gen-ts
RUN npm run build RUN npm run build

View File

@@ -4,10 +4,10 @@
"description": "backend for rush cahracter archive", "description": "backend for rush cahracter archive",
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {
"build_protos": "mkdir src/proto & npx protoc -I=../proto --ts_out=src/proto ../proto/*", "build_protos": "mkdir -p src/proto & npx protoc -I=../proto --ts_out=src/proto ../proto/*",
"build": "mkdir src/proto & npx protoc -I=../proto --ts_out=src/proto ../proto/* & tsc", "build": "mkdir -p src/proto & npx protoc -I=../proto --ts_out=src/proto ../proto/* & tsc",
"start": "mkdir src/proto & npx protoc -I=../proto --ts_out=src/proto ../proto/* & tsc && node dist/app.js", "start": "mkdir -p src/proto & npx protoc -I=../proto --ts_out=src/proto ../proto/* & tsc && node dist/app.js",
"dev": "mkdir src/proto & npx protoc -I=../proto --ts_out=src/proto ../proto/* & npx ts-node-dev src/app.ts", "dev": "mkdir -p src/proto & npx protoc -I=../proto --ts_out=src/proto ../proto/* & npx ts-node-dev src/app.ts",
"test": "echo \"Error: no test specified\" && exit 1", "test": "echo \"Error: no test specified\" && exit 1",
"format": "npx prettier . --write", "format": "npx prettier . --write",
"lint": "npx eslint . --ext .ts" "lint": "npx eslint . --ext .ts"

View File

@@ -1,7 +1,5 @@
// import express from 'express'
import * as grpc from '@grpc/grpc-js' import * as grpc from '@grpc/grpc-js'
// import { Character } from './proto/character'
import { initCharacterService } from './character_service' import { initCharacterService } from './character_service'
const port = 8000; const port = 8000;
@@ -12,15 +10,4 @@ initCharacterService(app)
app.bindAsync("0.0.0.0:8000", grpc.ServerCredentials.createInsecure(), () => { app.bindAsync("0.0.0.0:8000", grpc.ServerCredentials.createInsecure(), () => {
console.log("Starting server at 0.0.0.0:8000") console.log("Starting server at 0.0.0.0:8000")
}) })
// const app = express()
// app.get('/api/person', async (req, res) => {
// res.status(200).send('potato!')
// })
// app.listen(port, async () => {
// console.log(`Express is listening at http://localhost:${port}`)
// return
// })

View File

@@ -1,7 +1,10 @@
import * as grpc from '@grpc/grpc-js' import * as grpc from '@grpc/grpc-js'
import { Character } from './proto/character' import { Character, GetCharacterRequest, GetCharacterResponse } from './proto/character'
export function initCharacterService(server: grpc.Server) { export function initCharacterService(server: grpc.Server) {
}
function getCharacter(request: GetCharacterRequest): GetCharacterResponse {
return new GetCharacterResponse()
} }