Wave/Wave/Dockerfile
Mia Rose Winter 1d55ab23f0
Implemented client side article editor (#6)
* started implementing article API, missing lots of tests to validate feature

* made tests more pretty

* re-structured tests

* refactored dto contracts

* tested and fixed updating categories

* added permission tests, fixed bug in Permissions system

* added data validation tests for update article

* refactored repository interface

* Added ArticleView dto, fixed bug in requesting articles over repository

* updated dependencies

* optimized program.cs, added repo service

* Removed all interactivity from ArticleEditor, merged files

* added vite, tailwind working, dev server is not, js is not yet

* added fontsource for font management using vite's bundling

* moved vite output to wwwroot/dist
reorganized stuff that will never need processing or needs to be at site root

* fixed heading font weight not being 700 anymore

* implemented react in ArticleEditor

* added article status steps to react component
noticed I need to figure out client side localization

* fixed vite dev server thingies, tailwind and react refresh works now

* added article form skeletton to react

* more editor implementations

* minor typescript fixes

* implemented proper editor functions

* added all missing toolbar buttons

* fixed error, made open article work

* improved article editor structure

* implemented article editor taking id from the url

* Implemented categories endpoint

* implemented categories in article editor

* fixed minor TS issues

* implemented localization in article editor

* completed localization

* implemented loading selected categories

* minor code improvements and maybe a regex fix

* fixed bug with not getting unpublished articles

* implemented form state

* fixed validation issues

* implemented saving (missing creation)

* fixed minor bug with status display

* organized models

* added live markdown preview (incomplete)

* fixed issues in article create api endpoint

* improved article saving, implemented creating

* fixed publish date not being set correctly when creating article

* fixed slugs once more

* added run config for production (without vite dev)

* removed unused code

* updated dockerfile to build Assets

* fixed slug generation

* updated tests to validate new slug generator

* savsdSACAVSD

* fixed validation issues and tests
2024-06-18 09:09:47 +02:00

58 lines
1.6 KiB
Docker

#See https://aka.ms/customizecontainer to learn how to customize your debug container and how Visual Studio uses this Dockerfile to build your images for faster debugging.
ARG BASE=8.0
FROM mcr.microsoft.com/dotnet/aspnet:$BASE AS base
RUN mkdir -p /app/files && chown app /app/files
RUN mkdir -p /configuration && chown app /configuration
RUN apt-get update && apt-get install -y curl
USER app
VOLUME /app/files
VOLUME /configuration
WORKDIR /app
EXPOSE 8080
HEALTHCHECK --start-period=5s --start-interval=15s --interval=30s --timeout=30s --retries=3 \
CMD curl --fail http://localhost:8080/health || exit 1
FROM node:20-alpine AS vite-build
WORKDIR /src
RUN mkdir -p "wwwroot"
COPY ["Wave/package.json", "Wave/package-lock.json", "./"]
RUN npm install
COPY [ \
"Wave/tsconfig.json", \
"Wave/tsconfig.node.json", \
"Wave/*.config.ts", \
"./"]
COPY ["Wave/Assets/", "./Assets/"]
RUN npx vite build
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
ARG BUILD_CONFIGURATION=Release
ARG VERSION=0.0.1
WORKDIR /src
COPY ["Wave/Wave.csproj", "Wave/"]
RUN dotnet restore "./Wave/Wave.csproj"
COPY . .
WORKDIR "/src/Wave"
RUN dotnet build "./Wave.csproj" \
-c $BUILD_CONFIGURATION \
-o /app/build \
-p:Version="${VERSION}"
FROM build AS publish
ARG BUILD_CONFIGURATION=Release
ARG VERSION=0.0.1
ARG VERSION_SUFFIX=
RUN dotnet publish "./Wave.csproj" \
-c $BUILD_CONFIGURATION \
-o /app/publish \
-p:UseAppHost=false \
-p:Version="${VERSION}"
FROM base AS final
WORKDIR /app
COPY --from=vite-build /src/wwwroot ./wwwroot
COPY --from=publish /app/publish .
COPY LICENSE .
ENTRYPOINT ["dotnet", "Wave.dll"]