-
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 (#13)
* Add Docker build files and instructions * pr reviews --------- Co-authored-by: violet <avioletheart@localhost> Co-authored-by: Oliveriver <oliveriver1@gmail.com>
- Loading branch information
1 parent
0504ea7
commit 1fc2338
Showing
8 changed files
with
90 additions
and
1 deletion.
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,15 @@ | ||
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 | ||
|
||
RUN echo "#!/bin/sh" >> /app/docker-entrypoint.sh \ | ||
&& echo "~/.dotnet/tools/dotnet-ef database update" >> /app/docker-entrypoint.sh \ | ||
&& echo "dotnet /app/bin/5dDiplomacyWithMultiverseTimeTravel.dll" >> /app/docker-entrypoint.sh \ | ||
&& chmod +x /app/docker-entrypoint.sh | ||
|
||
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(); |