mirror of
https://github.com/alexmickelson/canvasManagement.git
synced 2026-03-25 23:28:33 -06:00
added build steps
This commit is contained in:
10
nextjs/.dockerignore
Normal file
10
nextjs/.dockerignore
Normal file
@@ -0,0 +1,10 @@
|
||||
.next/
|
||||
node_modules/
|
||||
storage/
|
||||
temp/
|
||||
.env
|
||||
build.sh
|
||||
run.sh
|
||||
README.md
|
||||
|
||||
|
||||
15
nextjs/Dockerfile
Normal file
15
nextjs/Dockerfile
Normal file
@@ -0,0 +1,15 @@
|
||||
FROM node:22-alpine
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY package*.json .
|
||||
|
||||
RUN npm i
|
||||
|
||||
COPY . .
|
||||
|
||||
RUN mkdir -p storage
|
||||
|
||||
RUN npm run build
|
||||
|
||||
CMD [ "npm", "run", "start" ]
|
||||
19
nextjs/build.sh
Executable file
19
nextjs/build.sh
Executable file
@@ -0,0 +1,19 @@
|
||||
#!/bin/bash
|
||||
|
||||
MAJOR_VERSION="2"
|
||||
MINOR_VERSION="0"
|
||||
VERSION="$MAJOR_VERSION.$MINOR_VERSION"
|
||||
|
||||
docker build -t canvas_management:$VERSION .
|
||||
|
||||
|
||||
|
||||
echo "to push run: "
|
||||
echo ""
|
||||
echo "docker image tag canvas_management:$VERSION alexmickelson/canvas_management:$VERSION"
|
||||
echo "docker image tag canvas_management:$VERSION alexmickelson/canvas_management:$MAJOR_VERSION"
|
||||
echo "docker image tag canvas_management:latest alexmickelson/canvas_management:latest"
|
||||
echo "docker push alexmickelson/canvas_management:$VERSION"
|
||||
echo "docker push alexmickelson/canvas_management:$MAJOR_VERSION"
|
||||
echo "docker push alexmickelson/canvas_management:latest"
|
||||
|
||||
17
nextjs/docker-compose.yml
Normal file
17
nextjs/docker-compose.yml
Normal file
@@ -0,0 +1,17 @@
|
||||
services:
|
||||
canvas_manager:
|
||||
image: alexmickelson/canvas_management:2
|
||||
user: "1000:1000"
|
||||
ports:
|
||||
- 3000:3000
|
||||
env_file:
|
||||
- .env
|
||||
environment:
|
||||
- storageDirectory=/app/storage
|
||||
- TZ=America/Denver
|
||||
volumes:
|
||||
- ~/projects/faculty/1430/2024-fall-alex/modules:/app/storage/UX
|
||||
- ~/projects/faculty/4850_AdvancedFE/2024-fall-alex/modules:/app/storage/advanced_frontend
|
||||
- ~/projects/faculty/1810/2024-fall-alex/modules:/app/storage/intro_to_web
|
||||
# - ~/projects/faculty/1420/2024-fall/Modules:/app/storage/1420
|
||||
# - ~/projects/faculty/1425/2024-fall/Modules:/app/storage/1425
|
||||
@@ -6,6 +6,7 @@ import { getQueryClient } from "./providersQueryClientUtils";
|
||||
import { hydrateCourses } from "@/hooks/hookHydration";
|
||||
import { dehydrate, HydrationBoundary } from "@tanstack/react-query";
|
||||
import { MyToaster } from "./MyToaster";
|
||||
import { cookies } from "next/headers";
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: "Canvas Manager 2.0",
|
||||
@@ -19,6 +20,7 @@ export default async function RootLayout({
|
||||
const queryClient = getQueryClient();
|
||||
await hydrateCourses(queryClient);
|
||||
const dehydratedState = dehydrate(queryClient);
|
||||
cookies() // disables static page generation at build time
|
||||
|
||||
return (
|
||||
<html lang="en">
|
||||
|
||||
@@ -17,14 +17,16 @@ if (!isServer) {
|
||||
} else {
|
||||
const token = process.env.CANVAS_TOKEN;
|
||||
if (!token) {
|
||||
throw new Error("CANVAS_TOKEN not in environment");
|
||||
console.error("CANVAS_TOKEN not in environment")
|
||||
// throw new Error("CANVAS_TOKEN not in environment");
|
||||
} else {
|
||||
axiosClient.interceptors.request.use((config) => {
|
||||
if (config.url && config.url.startsWith(canvasBaseUrl)) {
|
||||
config.headers.set("Authorization", `Bearer ${token}`);
|
||||
}
|
||||
return config;
|
||||
});
|
||||
}
|
||||
axiosClient.interceptors.request.use((config) => {
|
||||
if (config.url && config.url.startsWith(canvasBaseUrl)) {
|
||||
config.headers.set("Authorization", `Bearer ${token}`);
|
||||
}
|
||||
return config;
|
||||
});
|
||||
}
|
||||
|
||||
axiosClient.interceptors.response.use(
|
||||
|
||||
Reference in New Issue
Block a user