Created
January 22, 2020 21:12
-
-
Save meisinger/37d2ca613b5019ee33ce67d17bcf72f4 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
version: '3' | |
services: | |
redis: | |
image: 'redis' | |
ports: | |
- '6379' | |
core: | |
build: ./core-api | |
extra_hosts: | |
- 'core.meisinger.com:196.168.1.10' | |
nginx: | |
build: ./core-web | |
ports: | |
- '8080:80' | |
extra_hosts: | |
- 'dev.meisinger.com:127.0.0.1' |
This file contains hidden or 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
FROM mcr.microsoft.com/dotnet/core/sdk:2.2 AS stage | |
WORKDIR /app | |
COPY *.csproj ./ | |
RUN dotnet restore | |
COPY . ./ | |
RUN dotnet publish -c Debug -o out | |
FROM mcr.microsoft.com/dotnet/core/aspnet:2.2 | |
WORKDIR /app | |
COPY --from=stage /app/out . | |
ENTRYPOINT ["dotnet", "core-api.dll"] |
This file contains hidden or 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
FROM node:11 as stage | |
WORKDIR /app | |
COPY ./package*.json /app/ | |
RUN npm install | |
COPY . /app/ | |
RUN npm run build | |
FROM nginx:1.15 | |
COPY --from=stage /app/build/ /usr/share/nginx/html | |
COPY ./nginx.conf /etc/nginx/conf.d/default.conf | |
CMD ['nginx', '-g', 'deamon off;'] |
This file contains hidden or 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
upstream hoist { | |
server core; | |
} | |
server { | |
listen 80; | |
root /usr/share/nginx/html; | |
index index.htm index.html; | |
location ~ ^/api/projects/([0-9]+) { | |
proxy_pass http://hoist/api/projects/$1; | |
proxy_redirect off; | |
} | |
location /api { | |
proxy_pass http://dev.meisinger.com:43001/api; | |
proxy_redirect off; | |
} | |
location / { | |
try_files $uri $uri/ /index.html =404; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment