feat: Update Dockerfile for Node 20 and add vite-env.d.ts for environment variables
This commit is contained in:
+6
-3
@@ -1,9 +1,10 @@
|
|||||||
FROM node:18-alpine AS build
|
FROM node:20-alpine AS build
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
ENV NODE_ENV=production
|
|
||||||
|
|
||||||
# Install dependencies
|
# Install dependencies (include devDependencies for the build)
|
||||||
COPY package*.json ./
|
COPY package*.json ./
|
||||||
|
# Ensure devDependencies are installed during the build
|
||||||
|
ENV NODE_ENV=development
|
||||||
RUN npm ci --silent
|
RUN npm ci --silent
|
||||||
|
|
||||||
# Copy source and build
|
# Copy source and build
|
||||||
@@ -11,6 +12,8 @@ COPY . .
|
|||||||
RUN npm run build
|
RUN npm run build
|
||||||
|
|
||||||
FROM nginx:stable-alpine AS production
|
FROM nginx:stable-alpine AS production
|
||||||
|
WORKDIR /usr/share/nginx/html
|
||||||
|
# Copy built files from the build stage
|
||||||
COPY --from=build /app/dist /usr/share/nginx/html
|
COPY --from=build /app/dist /usr/share/nginx/html
|
||||||
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
||||||
EXPOSE 80 443
|
EXPOSE 80 443
|
||||||
|
|||||||
Vendored
+24
@@ -0,0 +1,24 @@
|
|||||||
|
/// <reference types="vite/client" />
|
||||||
|
|
||||||
|
declare module '*.css';
|
||||||
|
declare module '*.scss';
|
||||||
|
declare module '*.png';
|
||||||
|
declare module '*.jpg';
|
||||||
|
declare module '*.jpeg';
|
||||||
|
declare module '*.svg';
|
||||||
|
declare module '*.mjs';
|
||||||
|
declare module 'pdfjs-dist/build/pdf.worker.mjs?url';
|
||||||
|
|
||||||
|
interface ImportMetaEnv {
|
||||||
|
readonly VITE_API_URL?: string;
|
||||||
|
readonly VITE_LINK_TO_GITHUB?: string;
|
||||||
|
readonly VITE_LINK_TO_LINKEDIN?: string;
|
||||||
|
readonly VITE_IP_Server?: string;
|
||||||
|
readonly VITE_MAIL?: string;
|
||||||
|
readonly VITE_NAME?: string;
|
||||||
|
// add other env vars here as needed
|
||||||
|
}
|
||||||
|
|
||||||
|
interface ImportMeta {
|
||||||
|
readonly env: ImportMetaEnv;
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user