Integrate frontend with docker

This commit is contained in:
femsci 2023-10-21 21:38:47 +02:00
parent fa46b965b5
commit a8173436ff
Signed by: femsci
GPG key ID: 08F7911F0E650C67
5 changed files with 547 additions and 446 deletions

View file

@ -2,3 +2,8 @@ http://localhost {
reverse_proxy /api/* http://sfood_api:80 reverse_proxy /api/* http://sfood_api:80
reverse_proxy http://sfood_ui:80 reverse_proxy http://sfood_ui:80
} }
http://localhost:44420 {
header Access-Control-Allow-Origin "*"
reverse_proxy http://sfood_ui:44420
}

View file

@ -29,5 +29,6 @@ services:
ports: ports:
- 80:80 - 80:80
- 443:443 - 443:443
- 44420:44420
volumes: volumes:
- ./dev.Caddyfile:/etc/caddy/Caddyfile - ./dev.Caddyfile:/etc/caddy/Caddyfile

View file

@ -8,7 +8,7 @@
<IsPackable>false</IsPackable> <IsPackable>false</IsPackable>
<SpaRoot>sfood\</SpaRoot> <SpaRoot>sfood\</SpaRoot>
<DefaultItemExcludes>$(DefaultItemExcludes);$(SpaRoot)node_modules\**</DefaultItemExcludes> <DefaultItemExcludes>$(DefaultItemExcludes);$(SpaRoot)node_modules\**</DefaultItemExcludes>
<SpaProxyServerUrl>https://localhost:44420</SpaProxyServerUrl> <SpaProxyServerUrl>http://localhost:44420</SpaProxyServerUrl>
<SpaProxyLaunchCommand>npm start</SpaProxyLaunchCommand> <SpaProxyLaunchCommand>npm start</SpaProxyLaunchCommand>
<ImplicitUsings>enable</ImplicitUsings> <ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup> </PropertyGroup>
@ -41,7 +41,7 @@
<!-- Include the newly-built files in the publish output --> <!-- Include the newly-built files in the publish output -->
<ItemGroup> <ItemGroup>
<DistFiles Include="$(SpaRoot)build\**" /> <DistFiles Include="$(SpaRoot)dist\**" />
<ResolvedFileToPublish Include="@(DistFiles->'%(FullPath)')" Exclude="@(ResolvedFileToPublish)"> <ResolvedFileToPublish Include="@(DistFiles->'%(FullPath)')" Exclude="@(ResolvedFileToPublish)">
<RelativePath>wwwroot\%(RecursiveDir)%(FileName)%(Extension)</RelativePath> <RelativePath>wwwroot\%(RecursiveDir)%(FileName)%(Extension)</RelativePath>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory> <CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>

File diff suppressed because it is too large Load diff

View file

@ -4,6 +4,7 @@
"version": "0.0.1", "version": "0.0.1",
"type": "module", "type": "module",
"scripts": { "scripts": {
"start": "ionic serve --port 44420 --no-open --external",
"dev": "vite", "dev": "vite",
"build": "tsc && vite build", "build": "tsc && vite build",
"preview": "vite preview", "preview": "vite preview",
@ -21,11 +22,13 @@
"@ionic/react-router": "^7.0.0", "@ionic/react-router": "^7.0.0",
"@types/react-router": "^5.1.20", "@types/react-router": "^5.1.20",
"@types/react-router-dom": "^5.3.3", "@types/react-router-dom": "^5.3.3",
"http-proxy-middleware": "^2.0.6",
"ionicons": "^7.0.0", "ionicons": "^7.0.0",
"react": "^18.2.0", "react": "^18.2.0",
"react-dom": "^18.2.0", "react-dom": "^18.2.0",
"react-router": "^5.3.4", "react-router": "^5.3.4",
"react-router-dom": "^5.3.4" "react-router-dom": "^5.3.4",
"run-script-os": "^1.1.6"
}, },
"devDependencies": { "devDependencies": {
"@capacitor/cli": "5.5.0", "@capacitor/cli": "5.5.0",