Docker for dev

This commit is contained in:
JongYeob Sheen 2023-11-13 13:24:50 +09:00
parent 3c45282455
commit dd76a37982
3 changed files with 8 additions and 4 deletions

View File

@ -1,5 +1,9 @@
DATABASE_URL="mysql://root:fbOgZ6Xxn5VXBYihjqygRXyaK6ZUgKL6@db/learnsteam_quiz"
//DATABASE_URL="mysql://learnsteam:fbOgZ6Xxn5VXBYihjqygRXyaK6ZUgKL6@127.0.0.1/learnsteam_quiz"
NEXTAUTH_URL=https://learnsteam-quiz.jongyeob.com
NEXT_PUBLIC_HOST=https://learnsteam-quiz.jongyeob.com
NEXT_PUBLIC_API_ENDPOINT=https://learnsteam-quiz.jongyeob.com
//NEXTAUTH_URL=http://localhost:3100
//NEXT_PUBLIC_HOST=http://localhost:3100
//NEXT_PUBLIC_API_ENDPOINT=http://localhost:3100
NEXTAUTH_SECRET=dd87d8220ed9535d3152910f62ca40fb8ae292ac527e9528425118406aebbce0

View File

@ -11,8 +11,8 @@ RUN yarn --frozen-lockfile
FROM base AS builder
WORKDIR /app
COPY .env.dev.sample .env
COPY . .
COPY .env.dev.sample .env
ENV NEXT_TELEMETRY_DISABLED 0
RUN yarn upgrade
RUN npx prisma generate
@ -40,7 +40,7 @@ COPY --from=builder --chown=nextjs:nodejs /app/prisma ./prisma
COPY --from=builder --chown=nextjs:nodejs /app/start.sh .
USER nextjs
EXPOSE 3000
ENV PORT 3000
EXPOSE 3100
ENV PORT 3100
CMD ["sh", "start.sh"]

View File

@ -16,7 +16,7 @@ services:
dockerfile: docker/dev/Dockerfile
image: learnsteam/learnsteam-quiz:dev
ports:
- "3100:3000"
- "3100:3100"
environment:
DB_HOST: db
DB_PORT: 3306