Skip to content

Instantly share code, notes, and snippets.

@berkayakcay
Created June 5, 2019 11:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save berkayakcay/914fdaa70a8f9e323c7e6100fb121882 to your computer and use it in GitHub Desktop.
Save berkayakcay/914fdaa70a8f9e323c7e6100fb121882 to your computer and use it in GitHub Desktop.
Run multiple service with supervisor in container - Dockerfile
#base image (with java) https://cloud.docker.com/u/nesbilgi/repository/docker/nesbilgi/alpine
FROM nesbilgi/alpine:aspnetcore-2.2.5 AS base
WORKDIR /app
FROM microsoft/dotnet:2.2-sdk AS build
WORKDIR /src
COPY src/MyApplication.csproj MyApplication/
FROM build AS publish
WORKDIR /src/MyApplication
RUN dotnet publish MyApplication.csproj -c Release -o /app
FROM base AS final
WORKDIR /app
COPY --from=publish /app .
# SECOND SERVICE
COPY /ext/second-service.jar /ext/second-service.jar
# SUPERVISOR
RUN mkdir -p /var/run/java/ /var/run/dotnet/
COPY /scripts/supervisor-kill-container.py /scripts/supervisor-kill-container.py
COPY /src/MyApplication/supervisord.conf /etc/supervisor/supervisord.conf
CMD ["supervisord", "-c", "/etc/supervisor/supervisord.conf"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment