Docker 수정
This commit is contained in:
parent
d8a5c1c0e4
commit
3c45282455
@ -1,5 +1,5 @@
|
|||||||
//DATABASE_URL="mysql://root:fbOgZ6Xxn5VXBYihjqygRXyaK6ZUgKL6@db/learnsteam_quiz"
|
DATABASE_URL="mysql://root:fbOgZ6Xxn5VXBYihjqygRXyaK6ZUgKL6@db/learnsteam_quiz"
|
||||||
DATABASE_URL="mysql://learnsteam:fbOgZ6Xxn5VXBYihjqygRXyaK6ZUgKL6@127.0.0.1/learnsteam_quiz"
|
//DATABASE_URL="mysql://learnsteam:fbOgZ6Xxn5VXBYihjqygRXyaK6ZUgKL6@127.0.0.1/learnsteam_quiz"
|
||||||
NEXTAUTH_URL=https://learnsteam-quiz.jongyeob.com
|
NEXTAUTH_URL=https://learnsteam-quiz.jongyeob.com
|
||||||
NEXT_PUBLIC_API_ENDPOINT=https://learnsteam-quiz.jongyeob.com
|
NEXT_PUBLIC_API_ENDPOINT=https://learnsteam-quiz.jongyeob.com
|
||||||
NEXTAUTH_SECRET=dd87d8220ed9535d3152910f62ca40fb8ae292ac527e9528425118406aebbce0
|
NEXTAUTH_SECRET=dd87d8220ed9535d3152910f62ca40fb8ae292ac527e9528425118406aebbce0
|
@ -1,6 +1,6 @@
|
|||||||
//DATABASE_URL="mysql://learnsteam:fbOgZ6Xxn5VXBYihjqygRXyaK6ZUgKL6@jongyeob.com/learnsteam_quiz"
|
//DATABASE_URL="mysql://learnsteam:fbOgZ6Xxn5VXBYihjqygRXyaK6ZUgKL6@jongyeob.com/learnsteam_quiz"
|
||||||
//DATABASE_URL="mysql://root:fbOgZ6Xxn5VXBYihjqygRXyaK6ZUgKL6@db/learnsteam_quiz"
|
DATABASE_URL="mysql://root:fbOgZ6Xxn5VXBYihjqygRXyaK6ZUgKL6@db/learnsteam_quiz"
|
||||||
DATABASE_URL="mysql://learnsteam:fbOgZ6Xxn5VXBYihjqygRXyaK6ZUgKL6@127.0.0.1/learnsteam_quiz"
|
//DATABASE_URL="mysql://learnsteam:fbOgZ6Xxn5VXBYihjqygRXyaK6ZUgKL6@127.0.0.1/learnsteam_quiz"
|
||||||
NEXTAUTH_URL=http://localhost:3000
|
NEXTAUTH_URL=http://localhost:3000
|
||||||
NEXT_PUBLIC_HOST=http://localhost:3000
|
NEXT_PUBLIC_HOST=http://localhost:3000
|
||||||
NEXT_PUBLIC_API_ENDPOINT=http://localhost:3000
|
NEXT_PUBLIC_API_ENDPOINT=http://localhost:3000
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
DATABASE_URL="mysql://root:fbOgZ6Xxn5VXBYihjqygRXyaK6ZUgKL6@db/learnsteam_quiz"
|
||||||
//DATABASE_URL="mysql://learnsteam:fbOgZ6Xxn5VXBYihjqygRXyaK6ZUgKL6@jongyeob.com/learnsteam_quiz"
|
//DATABASE_URL="mysql://learnsteam:fbOgZ6Xxn5VXBYihjqygRXyaK6ZUgKL6@jongyeob.com/learnsteam_quiz"
|
||||||
NEXTAUTH_URL=https://learnsteam-quiz.jongyeob.com
|
NEXTAUTH_URL=https://learnsteam-quiz.jongyeob.com
|
||||||
NEXT_PUBLIC_HOST=https://learnsteam-quiz.jongyeob.com
|
NEXT_PUBLIC_HOST=https://learnsteam-quiz.jongyeob.com
|
||||||
|
@ -18,10 +18,14 @@ RUN yarn upgrade
|
|||||||
RUN npx prisma generate
|
RUN npx prisma generate
|
||||||
RUN yarn build
|
RUN yarn build
|
||||||
RUN npm prune --production
|
RUN npm prune --production
|
||||||
|
COPY ./script/start.sh .
|
||||||
|
RUN chmod +x start.sh
|
||||||
|
|
||||||
FROM alpine AS runner
|
FROM alpine AS runner
|
||||||
RUN apk add --no-cache nodejs
|
RUN apk add --no-cache nodejs npm
|
||||||
|
RUN npm install npx -g
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
ENV NODE_ENV production
|
ENV NODE_ENV production
|
||||||
RUN addgroup --system --gid 1001 nodejs
|
RUN addgroup --system --gid 1001 nodejs
|
||||||
RUN adduser --system --uid 1001 nextjs
|
RUN adduser --system --uid 1001 nextjs
|
||||||
@ -31,9 +35,9 @@ COPY --from=builder --chown=nextjs:nodejs /app/public ./public
|
|||||||
COPY --from=builder --chown=nextjs:nodejs /app/package.json ./package.json
|
COPY --from=builder --chown=nextjs:nodejs /app/package.json ./package.json
|
||||||
COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
|
COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
|
||||||
COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static
|
COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static
|
||||||
# COPY --from=builder --chown=nextjs:nodejs /app/node_modules ./node_modules
|
COPY --from=builder --chown=nextjs:nodejs /app/node_modules ./node_modules
|
||||||
# COPY --from=builder --chown=nextjs:nodejs /app/prisma ./prisma
|
COPY --from=builder --chown=nextjs:nodejs /app/prisma ./prisma
|
||||||
# COPY --from=builder --chown=nextjs:nodejs /app/start.sh .
|
COPY --from=builder --chown=nextjs:nodejs /app/start.sh .
|
||||||
|
|
||||||
USER nextjs
|
USER nextjs
|
||||||
EXPOSE 3000
|
EXPOSE 3000
|
||||||
|
@ -1,10 +1,30 @@
|
|||||||
version: "3"
|
version: "3"
|
||||||
|
|
||||||
services:
|
services:
|
||||||
|
db:
|
||||||
|
image: mysql:latest
|
||||||
|
environment:
|
||||||
|
MYSQL_ROOT_PASSWORD: fbOgZ6Xxn5VXBYihjqygRXyaK6ZUgKL6
|
||||||
|
MYSQL_DATABASE: learnsteam_quiz
|
||||||
|
ports:
|
||||||
|
- "33062:3306"
|
||||||
|
volumes:
|
||||||
|
- db-data:/var/lib/mysql
|
||||||
app:
|
app:
|
||||||
build:
|
build:
|
||||||
context: ../../
|
context: ../../
|
||||||
dockerfile: docker/dev/Dockerfile
|
dockerfile: docker/dev/Dockerfile
|
||||||
image: learnsteam/learnsteam-quiz:dev
|
image: learnsteam/learnsteam-quiz:dev
|
||||||
ports:
|
ports:
|
||||||
- "3000:3000"
|
- "3100:3000"
|
||||||
|
environment:
|
||||||
|
DB_HOST: db
|
||||||
|
DB_PORT: 3306
|
||||||
|
DB_USER: root
|
||||||
|
DB_PASSWORD: fbOgZ6Xxn5VXBYihjqygRXyaK6ZUgKL6
|
||||||
|
DB_NAME: learnsteam_quiz
|
||||||
|
depends_on:
|
||||||
|
- db
|
||||||
|
restart: always
|
||||||
|
volumes:
|
||||||
|
db-data:
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
FROM node:alpine AS base
|
FROM node:21-alpine AS base
|
||||||
|
|
||||||
FROM base AS deps
|
FROM base AS deps
|
||||||
RUN apk add --no-cache libc6-compat
|
RUN apk add --no-cache libc6-compat
|
||||||
@ -11,18 +11,20 @@ RUN yarn --frozen-lockfile
|
|||||||
|
|
||||||
FROM base AS builder
|
FROM base AS builder
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY .env.local.sample .env.production
|
|
||||||
COPY . .
|
COPY . .
|
||||||
|
COPY .env.local.sample .env
|
||||||
ENV NEXT_TELEMETRY_DISABLED 0
|
ENV NEXT_TELEMETRY_DISABLED 0
|
||||||
|
RUN yarn upgrade
|
||||||
RUN npx prisma generate
|
RUN npx prisma generate
|
||||||
RUN yarn build
|
RUN yarn build
|
||||||
RUN npm prune --production
|
RUN npm prune --production
|
||||||
COPY ./script/start.sh .
|
COPY ./script/start.sh .
|
||||||
|
RUN chmod +x start.sh
|
||||||
|
|
||||||
# FROM alpine AS runner
|
FROM alpine AS runner
|
||||||
# RUN apk add --no-cache nodejs npm
|
RUN apk add --no-cache nodejs npm
|
||||||
# RUN npm install npx -g
|
RUN npm install npx -g
|
||||||
# WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
ENV NODE_ENV production
|
ENV NODE_ENV production
|
||||||
RUN addgroup --system --gid 1001 nodejs
|
RUN addgroup --system --gid 1001 nodejs
|
||||||
@ -33,6 +35,7 @@ COPY --from=builder --chown=nextjs:nodejs /app/public ./public
|
|||||||
COPY --from=builder --chown=nextjs:nodejs /app/package.json ./package.json
|
COPY --from=builder --chown=nextjs:nodejs /app/package.json ./package.json
|
||||||
COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
|
COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
|
||||||
COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static
|
COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static
|
||||||
|
COPY --from=builder --chown=nextjs:nodejs /app/node_modules ./node_modules
|
||||||
COPY --from=builder --chown=nextjs:nodejs /app/prisma ./prisma
|
COPY --from=builder --chown=nextjs:nodejs /app/prisma ./prisma
|
||||||
COPY --from=builder --chown=nextjs:nodejs /app/start.sh .
|
COPY --from=builder --chown=nextjs:nodejs /app/start.sh .
|
||||||
|
|
||||||
|
@ -36,7 +36,6 @@ model Program {
|
|||||||
@@map("program")
|
@@map("program")
|
||||||
|
|
||||||
@@index([course])
|
@@index([course])
|
||||||
@@index([tag])
|
|
||||||
@@index([status])
|
@@index([status])
|
||||||
@@index([updated_at])
|
@@index([updated_at])
|
||||||
@@index([created_at])
|
@@index([created_at])
|
||||||
|
5
script/start.sh
Normal file
5
script/start.sh
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
npx prisma generate
|
||||||
|
npx prisma db push
|
||||||
|
node server.js
|
@ -72,7 +72,7 @@ const QuizCheckPanel = (props: Props) => {
|
|||||||
<Checkbox> </Checkbox>
|
<Checkbox> </Checkbox>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Flex gap="middle" wrap="wrap" style={{ flex: 1 }}>
|
<Flex gap="middle" wrap="wrap" style={{ flex: 1 }}>
|
||||||
<Preview source={quiz?.choice[1]} style={{ width: "100%" }} />
|
<Preview source={c} style={{ width: "100%" }} />
|
||||||
</Flex>
|
</Flex>
|
||||||
</Flex>
|
</Flex>
|
||||||
</Card>
|
</Card>
|
||||||
|
Loading…
Reference in New Issue
Block a user