73bf5193c4
- Implemented image downloading and optimization in QuickImportService. - Added imageUrl field to CreateRecipeDto for recipe creation. - Created an endpoint in RecipesController to update recipe images. - Enhanced RecipesService to handle image URL updates and optimizations. - Updated Docker Compose to mount a volume for recipe images. - Refactored frontend to display images in recipe grids and detail views. - Added a new utility function for downloading and optimizing images. - Created a new API route for handling image uploads. - Introduced RecipeGrid component for better recipe display. - Updated RecipeDetailClient to manage image updates and display. - Added migration for new imageUrl column in the Recipe table.
32 lines
707 B
Docker
32 lines
707 B
Docker
# Byggas från backend-mappen: docker build -t recipe-api:local .
|
|
|
|
# Stage 1: Bygg applikationen
|
|
FROM node:22-alpine AS builder
|
|
WORKDIR /app
|
|
|
|
# Kopiera backend-filer
|
|
COPY package.json ./
|
|
COPY prisma ./prisma
|
|
COPY src ./src
|
|
COPY tsconfig.json ./
|
|
COPY nest-cli.json ./
|
|
|
|
# Köra npm install
|
|
RUN npm install
|
|
|
|
RUN npx prisma generate
|
|
RUN npm run build
|
|
|
|
# Stage 2: Kör applikationen
|
|
FROM node:22-alpine AS runner
|
|
WORKDIR /app
|
|
ENV NODE_ENV=production
|
|
|
|
COPY --from=builder /app/package.json ./package.json
|
|
COPY --from=builder /app/node_modules ./node_modules
|
|
COPY --from=builder /app/prisma ./prisma
|
|
COPY --from=builder /app/dist ./dist
|
|
|
|
EXPOSE 8080
|
|
CMD ["sh", "-c", "npx prisma migrate deploy && node dist/main"]
|