Skip to content

Instantly share code, notes, and snippets.

@NileshGule
Last active August 7, 2018 15:03
Show Gist options
  • Save NileshGule/19bc4da6d13cc96a5431b39dccb7d389 to your computer and use it in GitHub Desktop.
Save NileshGule/19bc4da6d13cc96a5431b39dccb7d389 to your computer and use it in GitHub Desktop.
Files related to blog post on init-container
apiVersion: apps/v1beta1
kind: Deployment
metadata:
name: techtalksapi
namespace: abc2018sg
labels:
run: techtalksapi
spec:
replicas: 1
selector:
matchLabels:
run: techtalksapi
template:
metadata:
labels:
run: techtalksapi
spec:
initContainers:
- name: init-myservice
image: nileshgule/sqlclient
command:
- "sh"
- "-c"
- "/opt/mssql-tools/bin/sqlcmd -S db-deployment -U sa -P January2018 -d master -i initialize-database.sql"
containers:
- name: techtalksapi
image: nileshgule/techtalksapi:v1
env:
- name: ASPNETCORE_URLS
value: http://0.0.0.0:8080
- name: ConnectionStrings__DefaultConnection
value: "Data Source=db-deployment;Initial Catalog=TechTalksDB;User Id=SA;Password=January2018;MultipleActiveResultSets=True"
ports:
- containerPort: 8080
protocol: TCP
imagePullPolicy: Always
restartPolicy: Always
terminationGracePeriodSeconds: 30
dnsPolicy: ClusterFirst
version: '3'
services:
sql.data:
image: nileshgule/sqlclient
build:
context: ../TechTalksDB
dockerfile: Dockerfile
webmvc:
image: nileshgule/techtalksweb
build:
context: ..
dockerfile: Dockerfile-TechTalksWeb
depends_on:
- techtalks.api
ports:
- "80:80"
techtalks.api:
image: nileshgule/techtalksapi
build:
context: ..
dockerfile: Dockerfile-TechTalksAPI
depends_on:
- sql.data
ports:
- "8080:8080"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment