-
Notifications
You must be signed in to change notification settings - Fork 501
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
43 changed files
with
682 additions
and
408 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 @@ | ||
openbullet2-web-client/node_modules |
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
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,23 @@ | ||
name: Run tests | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
- staging | ||
pull_request: | ||
branches: | ||
- master | ||
- staging | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Setup .NET 8 | ||
uses: actions/setup-dotnet@v4 | ||
with: | ||
dotnet-version: 8.0.x | ||
- name: Unit and integration tests | ||
run: dotnet test |
This file was deleted.
Oops, something went wrong.
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,69 @@ | ||
# ------- | ||
# BACKEND | ||
# ------- | ||
FROM mcr.microsoft.com/dotnet/sdk:8.0-bookworm-slim AS backend | ||
|
||
WORKDIR /code | ||
|
||
COPY . . | ||
RUN dotnet publish OpenBullet2.Web -c Release -o /build/web | ||
|
||
WORKDIR /build/web | ||
|
||
# Remove all .xml files | ||
# (we cannot use <GenerateDocumentationFile>false</GenerateDocumentationFile> | ||
# because we need it for swagger) | ||
RUN find . -name "*.xml" -type f -delete | ||
|
||
# Manually copy over the dbip-country-lite.mmdb file from /code to /build | ||
# since for some reason it doesn't get copied over by the dotnet publish command | ||
RUN cp /code/OpenBullet2.Web/dbip-country-lite.mmdb /build | ||
|
||
# -------- | ||
# FRONTEND | ||
# -------- | ||
FROM node:20.9.0 AS frontend | ||
|
||
WORKDIR /code | ||
|
||
COPY openbullet2-web-client/package.json . | ||
COPY openbullet2-web-client/package-lock.json . | ||
RUN npm install | ||
|
||
COPY openbullet2-web-client . | ||
RUN npm run build | ||
RUN mkdir /build && mv dist/* /build | ||
|
||
# --------- | ||
# AGGREGATE | ||
# --------- | ||
FROM mcr.microsoft.com/dotnet/aspnet:8.0-bookworm-slim | ||
|
||
ENV DEBIAN_FRONTEND=noninteractive | ||
|
||
WORKDIR /app | ||
|
||
COPY --from=backend /build/web . | ||
COPY --from=frontend /build ./wwwroot | ||
COPY OpenBullet2.Web/dbip-country-lite.mmdb . | ||
|
||
# Install dependencies | ||
RUN apt-get update -yq && apt-get install -y --no-install-recommends apt-utils | ||
RUN apt-get upgrade -yq && apt-get install -yq apt-utils curl git nano wget unzip python3 python3-pip | ||
|
||
# Setup nodejs | ||
RUN curl -sL https://deb.nodesource.com/setup_current.x | bash - && apt-get install -yq nodejs build-essential | ||
RUN echo "deb http://deb.debian.org/debian/ unstable main contrib non-free" >> /etc/apt/sources.list.d/debian.list | ||
|
||
# Install chromium and firefox for selenium and puppeteer | ||
RUN apt-get update -yq && apt-get install -y --no-install-recommends firefox chromium | ||
RUN pip3 install webdrivermanager || true | ||
RUN webdrivermanager firefox chrome --linkpath /usr/local/bin || true | ||
|
||
RUN apt-get clean && rm -rf /var/lib/apt/lists/* | ||
|
||
WORKDIR /app | ||
|
||
EXPOSE 5000 | ||
CMD ["dotnet", "./OpenBullet2.Web.dll", "--urls=http://*:5000"] | ||
|
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 was deleted.
Oops, something went wrong.
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
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
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
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
Oops, something went wrong.