Skip to content

Commit

Permalink
Merge pull request #724 from asuc-octo/datapuller-docker-config
Browse files Browse the repository at this point in the history
fix: add docker config for datapuller
  • Loading branch information
adit-bala authored Oct 1, 2024
2 parents bda60a9 + 8c50182 commit 7324061
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 0 deletions.
19 changes: 19 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,25 @@
FROM node:alpine AS base
RUN ["npm", "install", "-g", "turbo@latest"]

# datapuller
FROM base AS datapuller-builder
WORKDIR /datapuller
COPY . .
RUN ["turbo", "prune", "datapuller", "--docker"]

FROM base AS datapuller-dev
WORKDIR /datapuller

COPY --from=datapuller-builder /datapuller/out/json/ .
COPY --from=datapuller-builder /datapuller/out/package-lock.json ./package-lock.json
RUN ["npm", "install"]

COPY --from=datapuller-builder /datapuller/out/full/ .
ENTRYPOINT ["turbo", "run", "course", "--filter=datapuller"]

FROM datapuller-dev AS datapuller-prod
ENTRYPOINT ["turbo", "run", "course", "--filter=datapuller", "--env-mode=loose"]

# backend
FROM base AS backend-builder
WORKDIR /backend
Expand Down
12 changes: 12 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,18 @@ networks:
bt:
name: bt
services:
datapuller:
build:
context: .
target: datapuller-dev
depends_on:
- mongodb
networks:
- bt
restart: always
volumes:
- ./apps/datapuller/src:/datapuller/apps/datapuller/src
- ./.env:/datapuller/apps/datapuller/.env
backend:
build:
context: .
Expand Down
3 changes: 3 additions & 0 deletions turbo.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
"dist/**"
]
},
"course": {
"cache": false
},
"generate": {
"outputs": [
"generated-types/**"
Expand Down

0 comments on commit 7324061

Please sign in to comment.