Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* dockerized webcrawler * functional docker-compose webcrawler * made it docker-compose can auto-scale tracker, crawler, and lighthouse roles
- Loading branch information
1 parent
871e6c3
commit caa5ca5
Showing
16 changed files
with
238 additions
and
3 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,12 @@ | ||
.dockerignore | ||
.env | ||
.git | ||
.gitignore | ||
.vs | ||
.vscode | ||
docker-compose.yml | ||
docker-compose.*.yml | ||
*/bin | ||
*/obj | ||
!obj/Docker/publish/* | ||
!obj/Docker/empty/ |
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,9 @@ | ||
version: '3' | ||
|
||
services: | ||
ci-build: | ||
image: microsoft/aspnetcore-build:1.0-2.0 | ||
volumes: | ||
- .:/src | ||
working_dir: /src | ||
command: /bin/bash -c "dotnet restore ./WebCrawler.sln && dotnet publish ./WebCrawler.sln -c Release -o ./obj/Docker/publish" |
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,19 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project ToolsVersion="15.0" Sdk="Microsoft.Docker.Sdk"> | ||
<PropertyGroup Label="Globals"> | ||
<ProjectVersion>2.0</ProjectVersion> | ||
<DockerTargetOS>Linux</DockerTargetOS> | ||
<ProjectGuid>188b87e9-7ff0-4488-a340-fe8a62688b27</ProjectGuid> | ||
<DockerLaunchBrowser>True</DockerLaunchBrowser> | ||
<DockerServiceUrl>http://localhost:{ServicePort}</DockerServiceUrl> | ||
<DockerServiceName>webcrawler.web</DockerServiceName> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<None Include="docker-compose.override.yml"> | ||
<DependentUpon>docker-compose.yml</DependentUpon> | ||
</None> | ||
<None Include="docker-compose.yml" /> | ||
<None Include=".dockerignore" /> | ||
<None Include="docker-compose.ci.build.yml" /> | ||
</ItemGroup> | ||
</Project> |
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 @@ | ||
version: '3' | ||
|
||
services: | ||
webcrawler.web: | ||
environment: | ||
- ASPNETCORE_ENVIRONMENT=Development | ||
ports: | ||
- "80" |
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,52 @@ | ||
version: '3' | ||
|
||
services: | ||
lighthouse: | ||
image: petabridge/lighthouse:0.9.1 | ||
ports: | ||
- '9110:9110' | ||
- '4053:4053' | ||
environment: | ||
ACTORSYSTEM: "webcrawler" | ||
CLUSTER_IP: lighthouse | ||
CLUSTER_PORT: 4053 | ||
CLUSTER_SEEDS: "akka.tcp://webcrawler@lighthouse:4053" | ||
|
||
|
||
webcrawler.web: | ||
image: webcrawler.web | ||
build: | ||
context: . | ||
dockerfile: src/WebCrawler.Web/Dockerfile | ||
ports: | ||
- '8080:80' | ||
environment: | ||
CLUSTER_SEEDS: "akka.tcp://webcrawler@lighthouse:4053" | ||
CLUSTER_IP: webcrawler.web | ||
CLUSTER_PORT: 0 | ||
depends_on: | ||
- "lighthouse" | ||
|
||
webcrawler.crawlservice: | ||
image: webcrawler.crawlservice | ||
build: | ||
context: . | ||
dockerfile: src/WebCrawler.CrawlService/Dockerfile | ||
environment: | ||
CLUSTER_SEEDS: "akka.tcp://webcrawler@lighthouse:4053" | ||
CLUSTER_IP: webcrawler.crawlservice | ||
CLUSTER_PORT: 0 | ||
depends_on: | ||
- "lighthouse" | ||
|
||
webcrawler.trackerservice: | ||
image: webcrawler.trackerservice | ||
build: | ||
context: . | ||
dockerfile: src/WebCrawler.TrackerService/Dockerfile | ||
environment: | ||
CLUSTER_SEEDS: "akka.tcp://webcrawler@lighthouse:4053" | ||
CLUSTER_IP: webcrawler.trackerservice | ||
CLUSTER_PORT: 0 | ||
depends_on: | ||
- "lighthouse" |
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 @@ | ||
#!/bin/sh | ||
if [ -z "$CLUSTER_IP"]; then | ||
host=$(hostname -i) | ||
echo "Docker container bound on $host" | ||
export CLUSTER_IP="$host" | ||
else | ||
echo "Docker container bound on $CLUSTER_IP" | ||
fi | ||
|
||
exec "$@" |
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,34 @@ | ||
FROM microsoft/dotnet:2.0-runtime AS base | ||
WORKDIR /app | ||
|
||
# should be a comma-delimited list | ||
ENV CLUSTER_SEEDS "[]" | ||
ENV CLUSTER_IP "" | ||
ENV CLUSTER_PORT "5213" | ||
|
||
#Akka.Remote inbound listening endpoint | ||
EXPOSE 5213 | ||
|
||
FROM microsoft/dotnet:2.0-sdk AS build | ||
WORKDIR /src | ||
COPY *.sln ./ | ||
COPY ./get-dockerip.sh ./get-dockerip.sh | ||
COPY src/WebCrawler.CrawlService/WebCrawler.CrawlService.csproj src/WebCrawler.CrawlService/ | ||
COPY src/WebCrawler.Shared/WebCrawler.Shared.csproj src/WebCrawler.Shared/ | ||
COPY src/WebCrawler.Shared.IO/WebCrawler.Shared.IO.csproj src/WebCrawler.Shared.IO/ | ||
RUN dotnet restore | ||
COPY . . | ||
WORKDIR /src/src/WebCrawler.CrawlService | ||
RUN dotnet build -c Release -o /app | ||
|
||
FROM build AS publish | ||
RUN dotnet publish -c Release -o /app | ||
|
||
FROM base AS final | ||
WORKDIR /app | ||
COPY --from=build /src/get-dockerip.sh ./get-dockerip.sh | ||
COPY --from=publish /app . | ||
|
||
ENTRYPOINT ["/bin/bash","get-dockerip.sh"] | ||
|
||
CMD ["dotnet", "WebCrawler.CrawlService.dll"] |
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
34 changes: 34 additions & 0 deletions
34
Cluster.WebCrawler/src/WebCrawler.TrackerService/Dockerfile
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,34 @@ | ||
FROM microsoft/dotnet:2.0-runtime AS base | ||
WORKDIR /app | ||
|
||
# should be a comma-delimited list | ||
ENV CLUSTER_SEEDS "[]" | ||
ENV CLUSTER_IP "" | ||
ENV CLUSTER_PORT "5212" | ||
|
||
#Akka.Remote inbound listening endpoint | ||
EXPOSE 5212 | ||
|
||
FROM microsoft/dotnet:2.0-sdk AS build | ||
WORKDIR /src | ||
COPY *.sln ./ | ||
COPY ./get-dockerip.sh ./get-dockerip.sh | ||
COPY src/WebCrawler.TrackerService/WebCrawler.TrackerService.csproj src/WebCrawler.TrackerService/ | ||
COPY src/WebCrawler.Shared/WebCrawler.Shared.csproj src/WebCrawler.Shared/ | ||
COPY src/WebCrawler.Shared.IO/WebCrawler.Shared.IO.csproj src/WebCrawler.Shared.IO/ | ||
RUN dotnet restore | ||
COPY . . | ||
WORKDIR /src/src/WebCrawler.TrackerService | ||
RUN dotnet build -c Release -o /app | ||
|
||
FROM build AS publish | ||
RUN dotnet publish -c Release -o /app | ||
|
||
FROM base AS final | ||
WORKDIR /app | ||
COPY --from=build /src/get-dockerip.sh ./get-dockerip.sh | ||
COPY --from=publish /app . | ||
|
||
ENTRYPOINT ["/bin/bash","get-dockerip.sh"] | ||
|
||
CMD ["dotnet", "WebCrawler.TrackerService.dll"] |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
FROM microsoft/aspnetcore:2.0 AS base | ||
WORKDIR /app | ||
|
||
# should be a comma-delimited list | ||
ENV CLUSTER_SEEDS "[]" | ||
ENV CLUSTER_IP "" | ||
ENV CLUSTER_PORT "16666" | ||
|
||
EXPOSE 80 | ||
|
||
#Akka.Remote inbound listening endpoint | ||
EXPOSE 16666 | ||
|
||
|
||
FROM microsoft/aspnetcore-build:2.0 AS build | ||
WORKDIR /src | ||
COPY *.sln ./ | ||
COPY ./get-dockerip.sh ./get-dockerip.sh | ||
COPY src/WebCrawler.Web/WebCrawler.Web.csproj src/WebCrawler.Web/ | ||
COPY src/WebCrawler.Shared/WebCrawler.Shared.csproj src/WebCrawler.Shared/ | ||
RUN dotnet restore | ||
COPY . . | ||
WORKDIR /src/src/WebCrawler.Web | ||
RUN dotnet build -c Release -o /app | ||
|
||
FROM build AS publish | ||
RUN dotnet publish -c Release -o /app | ||
|
||
FROM base AS final | ||
WORKDIR /app | ||
COPY --from=build /src/get-dockerip.sh ./get-dockerip.sh | ||
COPY --from=publish /app . | ||
|
||
ENTRYPOINT ["/bin/bash","get-dockerip.sh"] | ||
|
||
CMD ["dotnet", "WebCrawler.Web.dll"] |
10 changes: 10 additions & 0 deletions
10
Cluster.WebCrawler/src/WebCrawler.Web/WebCrawler.Web.csproj
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