Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add docker config for datapuller #724

Merged
merged 1 commit into from
Oct 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading