womp
This commit is contained in:
parent
aeea6bfb84
commit
12c4dd2aef
5 changed files with 14 additions and 3 deletions
4
Frontend/.env
Normal file
4
Frontend/.env
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
NEXT_PUBLIC_API_URL="https://projektbackend.lona-development.org"
|
||||||
|
API_URL="https://projektbackend.lona-development.org"
|
||||||
|
NEXTAUTH_SECRET="fuerfortnite"
|
||||||
|
NEXTAUTH_URL="https://projekt.lona-development.org"
|
||||||
|
|
@ -11,6 +11,10 @@ FROM base AS builder
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY --from=deps /app/node_modules ./node_modules
|
COPY --from=deps /app/node_modules ./node_modules
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
|
ARG NEXT_PUBLIC_API_URL
|
||||||
|
ENV NEXT_PUBLIC_API_URL=$NEXT_PUBLIC_API_URL
|
||||||
|
|
||||||
RUN npm run build
|
RUN npm run build
|
||||||
|
|
||||||
# Production image, copy all the files and run next
|
# Production image, copy all the files and run next
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ const handler = NextAuth({
|
||||||
if (!credentials?.email || !credentials?.password) return null
|
if (!credentials?.email || !credentials?.password) return null
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const res = await fetch(`${process.env.API_URL || 'http://localhost:8080'}/api/auth/login`, {
|
const res = await fetch(`${process.env.API_URL}/api/auth/login`, {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
headers: { "Content-Type": "application/json" },
|
headers: { "Content-Type": "application/json" },
|
||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ import { createContext, useContext, useState, useCallback, useEffect, type React
|
||||||
import { useSession, signIn, signOut } from "next-auth/react"
|
import { useSession, signIn, signOut } from "next-auth/react"
|
||||||
import type { User, Ticket, TicketStatus, Room } from "./types"
|
import type { User, Ticket, TicketStatus, Room } from "./types"
|
||||||
|
|
||||||
const API_URL = process.env.NEXT_PUBLIC_API_URL || "http://localhost:8080/api"
|
const API_URL = process.env.NEXT_PUBLIC_API_URL
|
||||||
|
|
||||||
interface AuthContextType {
|
interface AuthContextType {
|
||||||
user: User | null
|
user: User | null
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,10 @@ services:
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
|
||||||
frontend:
|
frontend:
|
||||||
build: ./Frontend
|
build:
|
||||||
|
context: ./Frontend
|
||||||
|
args:
|
||||||
|
NEXT_PUBLIC_API_URL: ${NEXT_PUBLIC_API_URL}
|
||||||
container_name: ticketsystem-frontend
|
container_name: ticketsystem-frontend
|
||||||
environment:
|
environment:
|
||||||
NEXT_PUBLIC_API_URL: ${NEXT_PUBLIC_API_URL:-http://projekt.lona-development.org/api}
|
NEXT_PUBLIC_API_URL: ${NEXT_PUBLIC_API_URL:-http://projekt.lona-development.org/api}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue