This commit is contained in:
Martin Pander
2023-12-09 19:34:45 +01:00
parent 32346e0aa9
commit 8addda35ea
144 changed files with 7247 additions and 3268 deletions

45
frontend/Dockerfile Normal file
View File

@ -0,0 +1,45 @@
# Step 1: Build the application
FROM node:18 AS build
ARG VITE_API_HOST
ARG VITE_API_PORT
# Use ARG to Set ENV (if needed)
ENV VITE_API_HOST=${VITE_API_HOST}
ENV VITE_API_PORT=${VITE_API_PORT}
# Set the working directory
WORKDIR /usr/src/app
# Copy package.json and package-lock.json
COPY package*.json ./
# Install dependencies
RUN npm install
# Copy project files
COPY . .
# Build the SvelteKit application
RUN npm run build
# Step 2: Run the application
FROM node:18
# Set the working directory
WORKDIR /usr/src/app
# Copy package.json and package-lock.json
COPY package*.json ./
# Install production dependencies only
RUN npm install --production
# Copy built files from the build stage
COPY --from=build /usr/src/app/build ./build
# Expose the port the app runs on
EXPOSE 3000
# Define the command to run the app
CMD ["node", "build"]