anan7
anan715mo ago

Dockerfile in Tubrorepo

Hi I have a Turborepo where I have a nextjs frontend “web” and an express backend “api” both connected through trpc (guess that’s obv). I’m kinda finding it difficult to create a docker image for this 🫠 has anybody else done this before? Any example I could take a look at? Thanks!
4 Replies
Nick
Nick15mo ago
If you can find a guide for hosting express in docker then it will also work for this If you have any specific issues though, we might be able to help
anan7
anan715mo ago
I'm actually failing to dockerise my nextjs app. forgot to mention that.
bazeso
bazeso15mo ago
Can you show us your Dockerfiles ?
anan7
anan715mo ago
FROM node:16-alpine RUN apk add --no-cache libc6-compat WORKDIR /app COPY . . ENV NODE_ENV=production ENV NEXT_TELEMETRY_DISABLED 1 RUN npm ci RUN npm run -w api dbgen RUN npm run -w web build EXPOSE 3000 CMD ["npm", "start", "-w", "web"] I've noticed my build fails when I use yarn and I want to use npm but in the build section, it says no lock file found and begins to use yarn. when I run that build command locally it builds perfectly.