-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Docker build files and instructions
- Loading branch information
violet
committed
Sep 19, 2024
1 parent
b6c1277
commit 97a00a0
Showing
10 changed files
with
88 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
mssql-data |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
http://:8080 { | ||
file_server /* { | ||
root /dist | ||
} | ||
handle_path /api/* { | ||
reverse_proxy http://backend:8080 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
FROM alpine:latest AS builder | ||
|
||
RUN apk add nodejs yarn | ||
|
||
WORKDIR /app | ||
COPY . . | ||
|
||
RUN yarn | ||
RUN VITE_SERVER_URL=/api yarn build | ||
|
||
FROM alpine:latest | ||
|
||
RUN apk add caddy | ||
COPY Caddyfile /etc/Caddyfile | ||
|
||
COPY --from=builder /app/dist /dist | ||
|
||
ENTRYPOINT [ "caddy", "run", "-c", "/etc/Caddyfile" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
services: | ||
frontend: | ||
build: client/ | ||
ports: | ||
- 127.0.0.1:5173:8080 | ||
restart: always | ||
backend: | ||
build: server/ | ||
environment: | ||
- "ConnectionStrings__Database=Server=mssql;Database=diplomacy;User=SA;Password=Passw0rd@;Encrypt=True;TrustServerCertificate=True" | ||
restart: always | ||
mssql: | ||
image: mcr.microsoft.com/mssql/server:2022-latest | ||
user: root | ||
environment: | ||
- ACCEPT_EULA=y | ||
- "MSSQL_SA_PASSWORD=Passw0rd@" | ||
volumes: | ||
- './mssql-data/data:/var/opt/mssql/data' | ||
- './mssql-data/log:/var/opt/mssql/log' | ||
- './mssql-data/secrets:/var/opt/mssql/secrets' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
bin/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build | ||
|
||
WORKDIR /app | ||
|
||
COPY . /app | ||
RUN dotnet build -c Release -o bin | ||
|
||
RUN dotnet tool install --global dotnet-ef | ||
|
||
CMD ["/app/docker-entrypoint.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,7 +31,6 @@ | |
.AllowAnyMethod()); | ||
} | ||
|
||
app.UseHttpsRedirection(); | ||
app.UseAuthorization(); | ||
app.MapControllers(); | ||
app.Run(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/bin/sh | ||
|
||
~/.dotnet/tools/dotnet-ef database update | ||
|
||
dotnet /app/bin/5dDiplomacyWithMultiverseTimeTravel.dll |