Skip to content

Commit

Permalink
Merge pull request #2 from goto/fix-docker-build
Browse files Browse the repository at this point in the history
fix: docker build fails
  • Loading branch information
StewartJingga authored Apr 11, 2023
2 parents e026810 + ff7560e commit edd174d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
6 changes: 4 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
FROM node:16.3.0-alpine AS builder
WORKDIR /app
COPY package*.json ./
RUN npm install
COPY yarn.lock ./
RUN yarn install
COPY . .
RUN npm run build

Expand All @@ -10,7 +11,8 @@ ENV NODE_ENV production
ENV NEW_RELIC_HOME ./build
WORKDIR /app
COPY package*.json ./
RUN npm ci --only=production
COPY yarn.lock ./
RUN yarn install
COPY --chown=node:node --from=builder ./app/build ./build
USER node
CMD ["npm", "start"]
1 change: 1 addition & 0 deletions Dockerfile.dev
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ FROM node:16.3.0
ENV NEW_RELIC_HOME ./src
WORKDIR /app
COPY package*.json ./
COPY yarn.lock ./
RUN npm install
COPY . .
EXPOSE 8000
Expand Down
8 changes: 5 additions & 3 deletions src/providers/connection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@ function santitizedCubeName(name: string) {
return patt.test(camelCaseName) ? camelCaseName : `Cube${camelCaseName}`;
}

function sanitizeTableSchema(tableSchame: { cube: string; joins: any[] }) {
function sanitizeTableSchema(tableSchame: {
cube: string;
joins: { cubeToJoin: string }[];
}) {
const joins = tableSchame.joins.map((j) => {
return { ...j, cubeToJoin: santitizedCubeName(j.cubeToJoin) };
});
Expand Down Expand Up @@ -70,8 +73,7 @@ export default class ConnectionProvider {
try {
await this.driver.testConnection();
return 'Success';
} catch (err) {
console.log(err);
} catch {
return 'Failure';
}
}
Expand Down

0 comments on commit edd174d

Please sign in to comment.