Skip to content
This repository has been archived by the owner on Feb 7, 2024. It is now read-only.

Commit

Permalink
docker init
Browse files Browse the repository at this point in the history
  • Loading branch information
janfabian committed Aug 2, 2023
1 parent dd68605 commit bb7dd1c
Show file tree
Hide file tree
Showing 19 changed files with 945 additions and 2,436 deletions.
7 changes: 7 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
**/node_modules/
**/dist
.git
npm-debug.log
.coverage
.coverage.*
*.tsbuildinfo
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
node_modules
dist
*.tsbuildinfo
36 changes: 36 additions & 0 deletions docker/build.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# build Typescript
FROM node:20-alpine3.17 as ts-compiler
WORKDIR /usr/app

COPY package*.json ./
COPY package/chore/package.json ./package/chore/
COPY package/hub/package.json ./package/hub/
COPY package/outpost/binance/package.json ./package/outpost/binance/
COPY package/protobuf/package.json ./package/protobuf/

COPY tsconfig.json ./
COPY package/chore/tsconfig.json ./package/chore/
COPY package/hub/tsconfig.json ./package/hub/
COPY package/outpost/binance/tsconfig.json ./package/outpost/binance/
COPY package/protobuf/tsconfig.json ./package/protobuf/

RUN npm install
COPY . ./
RUN npm run build

# copy build

FROM node:20-alpine3.17 as ts-remover
WORKDIR /usr/app
COPY --from=ts-compiler /usr/app/package*.json ./
COPY --from=ts-compiler /usr/app/package/chore/package.json ./package/chore/
COPY --from=ts-compiler /usr/app/package/hub/package.json ./package/hub/
COPY --from=ts-compiler /usr/app/package/outpost/binance/package.json ./package/outpost/binance/
COPY --from=ts-compiler /usr/app/package/protobuf/package.json ./package/protobuf/

COPY --from=ts-compiler /usr/app/package/hub/dist ./package/hub/dist/
COPY --from=ts-compiler /usr/app/package/outpost/binance/dist ./package/outpost/binance/dist/
COPY --from=ts-compiler /usr/app/package/protobuf ./package/protobuf/
RUN npm install --omit=dev

CMD ["index.js"]
Loading

0 comments on commit bb7dd1c

Please sign in to comment.