Fix docker

Signed-off-by: Odyssey <hi@odyssey346.dev>
This commit is contained in:
Odyssey
2023-04-03 22:04:33 +02:00
parent c9ac2cb958
commit 2e96148246
2 changed files with 10 additions and 1 deletions
+2
View File
@@ -10,5 +10,7 @@ COPY . /usr/src/app/
# expose the port
EXPOSE 8080
ENV DOCKER=true
# run the server
CMD [ "pwsh", "-c", "cd /usr/src/app; ./server.ps1" ]
+8 -1
View File
@@ -1,5 +1,12 @@
Start-PodeServer {
Add-PodeEndpoint -Address localhost -Port 8080 -Protocol Http
# get docker environment variable
$docker = $env:DOCKER
if ($docker) {
Add-PodeEndpoint -Address * -Port 8080 -Protocol Http
} else {
Add-PodeEndpoint -Address localhost -Port 8080 -Protocol Http
}
Add-PodeRoute -Method Get -Path '/' -ScriptBlock {
Write-PodeJsonResponse -Value @{ Response = 'Hello World' }