Skip to content

Commit

Permalink
fixed docker-compose build
Browse files Browse the repository at this point in the history
  • Loading branch information
Aaronontheweb committed Feb 4, 2019
1 parent d712ae4 commit ffb052a
Show file tree
Hide file tree
Showing 10 changed files with 49 additions and 82 deletions.
5 changes: 4 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@ version: '3.4'

services:
lighthouse:
image: petabridge/lighthouse:v0.9.2
image: webcrawler.lighthouse
build:
context: .
dockerfile: src/Lighthouse/Dockerfile
ports:
- '9110:9110'
- '4053:4053'
Expand Down
28 changes: 18 additions & 10 deletions src/Lighthouse/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,21 +1,29 @@
FROM microsoft/dotnet:1.1-sdk AS build-env
FROM microsoft/dotnet:2.0-runtime AS base
WORKDIR /app

ENV ACTORSYSTEM "lighthouse"

# should be a comma-delimited list
ENV SEEDS "[]"
ENV CLUSTER_SEEDS "[]"
ENV CLUSTER_IP ""
ENV CLUSTER_PORT "4053"

FROM microsoft/dotnet:2.0-sdk AS build
WORKDIR /src
COPY *.sln ./
COPY ./get-dockerip.sh ./get-dockerip.sh
COPY src/Lighthouse/Lighthouse.csproj src/Lighthouse/

COPY src/Lighthouse/*.csproj ./
RUN dotnet restore
COPY . .
WORKDIR /src/src/Lighthouse
RUN dotnet build -c Release -o /app

COPY src/Lighthouse ./
RUN dotnet publish -c Release --framework netcoreapp1.1 -o out
FROM build AS publish
RUN dotnet publish -c Release -o /app

FROM microsoft/dotnet:1.1-runtime AS runtime
FROM base AS final
WORKDIR /app
COPY --from=build-env /app/out ./
COPY --from=build-env /app/get-dockerip.sh ./get-dockerip.sh
COPY --from=publish /app ./
COPY --from=build /src/get-dockerip.sh ./get-dockerip.sh
ENTRYPOINT ["/bin/bash","get-dockerip.sh"]

# 9110 - Petabridge.Cmd
Expand Down
3 changes: 2 additions & 1 deletion src/Lighthouse/Lighthouse.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
<Import Project="..\common.props" />
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFrameworks>$(NetCoreVersion)</TargetFrameworks>
<TargetFramework>$(NetCoreVersion)</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Akka.Cluster" Version="$(AkkaVersion)" />
<PackageReference Include="Akka.Cluster.HealthCheck" Version="$(AkkaHealthCheckVersion)" />
<PackageReference Include="Microsoft.Extensions.Configuration" Version="1.1.2" />
<PackageReference Include="Microsoft.Extensions.Configuration.Xml" Version="1.1.2" />
<PackageReference Include="Petabridge.Cmd.Cluster" Version="$(PetabridgeCmdVersion)" />
Expand Down
4 changes: 1 addition & 3 deletions src/Lighthouse/Program.NetCore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@

namespace Lighthouse
{
public partial class Program
public class Program
{
#if NETCOREAPP1_1
public static void Main(string[] args)
{
var lighthouseService = new LighthouseService();
Expand All @@ -16,6 +15,5 @@ public static void Main(string[] args)
};
lighthouseService.TerminationHandle.Wait();
}
#endif
}
}
36 changes: 0 additions & 36 deletions src/Lighthouse/Program.NetFramework.cs

This file was deleted.

15 changes: 6 additions & 9 deletions src/WebCrawler.CrawlService/WebCrawler.CrawlService.csproj
Original file line number Diff line number Diff line change
@@ -1,23 +1,20 @@
<Project Sdk="Microsoft.NET.Sdk">

<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\common.props" />
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.0</TargetFramework>
<TargetFramework>$(NetCoreVersion)</TargetFramework>
</PropertyGroup>

<ItemGroup>
<None Remove="crawler.hocon" />
</ItemGroup>

<ItemGroup>
<Content Include="crawler.hocon">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
</ItemGroup>

<ItemGroup>
<PackageReference Include="Akka.Bootstrap.Docker" Version="0.1.3" />
<PackageReference Include="Akka.Cluster" Version="1.3.10" />
<PackageReference Include="Akka.Bootstrap.Docker" Version="$(AkkaBootstrapVersion)" />
<PackageReference Include="Akka.Cluster" Version="$(AkkaVersion)" />
<PackageReference Include="Akka.Cluster.HealthCheck" Version="$(AkkaHealthCheckVersion)" />
</ItemGroup>

<ItemGroup>
Expand Down
6 changes: 3 additions & 3 deletions src/WebCrawler.Shared.IO/WebCrawler.Shared.IO.csproj
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk">

<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\common.props" />
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Akka.Streams" Version="1.3.10" />
<PackageReference Include="Akka.Streams" Version="$(AkkaVersion)" />
<PackageReference Include="HtmlAgilityPack" Version="1.7.1" />
</ItemGroup>

Expand Down
6 changes: 3 additions & 3 deletions src/WebCrawler.Shared/WebCrawler.Shared.csproj
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk">

<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\common.props" />
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Akka" Version="1.3.10" />
<PackageReference Include="Akka" Version="$(AkkaVersion)" />
</ItemGroup>

</Project>
15 changes: 6 additions & 9 deletions src/WebCrawler.TrackerService/WebCrawler.TrackerService.csproj
Original file line number Diff line number Diff line change
@@ -1,23 +1,20 @@
<Project Sdk="Microsoft.NET.Sdk">

<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\common.props" />
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.0</TargetFramework>
<TargetFramework>$(NetCoreVersion)</TargetFramework>
</PropertyGroup>

<ItemGroup>
<None Remove="tracker.hocon" />
</ItemGroup>

<ItemGroup>
<Content Include="tracker.hocon">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
</ItemGroup>

<ItemGroup>
<PackageReference Include="Akka.Bootstrap.Docker" Version="0.1.3" />
<PackageReference Include="Akka.Cluster" Version="1.3.10" />
<PackageReference Include="Akka.Bootstrap.Docker" Version="$(AkkaBootstrapVersion)" />
<PackageReference Include="Akka.Cluster" Version="$(AkkaVersion)" />
<PackageReference Include="Akka.Cluster.HealthCheck" Version="$(AkkaHealthCheckVersion)" />
</ItemGroup>

<ItemGroup>
Expand Down
13 changes: 6 additions & 7 deletions src/WebCrawler.Web/WebCrawler.Web.csproj
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<Project Sdk="Microsoft.NET.Sdk.Web">
<Import Project="..\common.props" />
<PropertyGroup>
<TargetFramework>netcoreapp2.0</TargetFramework>
<TargetFramework>$(NetCoreVersion)</TargetFramework>
<DockerComposeProjectPath>..\..\docker-compose.dcproj</DockerComposeProjectPath>
</PropertyGroup>
<ItemGroup>
<None Remove="web.hocon" />
</ItemGroup>
<ItemGroup>
<Content Include="web.hocon">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Akka.Bootstrap.Docker" Version="0.1.3" />
<PackageReference Include="Akka.Cluster" Version="1.3.10" />
<PackageReference Include="Akka.Bootstrap.Docker" Version="$(AkkaBootstrapVersion)" />
<PackageReference Include="Akka.Cluster" Version="$(AkkaVersion)" />
<PackageReference Include="Akka.Cluster.HealthCheck" Version="$(AkkaHealthCheckVersion)" />
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.6" />
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="2.0.3" />
<PackageReference Include="Microsoft.AspNetCore.Server.Kestrel" Version="2.0.2" />
Expand Down

0 comments on commit ffb052a

Please sign in to comment.