In this article:
- Docker Compose Examples
- Kubernetes Examples
Docker Compose
Basic SQLite (HTTP)
services:
skylineglobeserver:
image: skylineglobe/skylineglobeserver:latest # Docker image to use
container_name: skylineglobeserver_container
restart: always
ports:
- "5000:5155" # Map container port to host. Adjust according to your app's exposed port
environment: # Configure SGS
SGS__ServerConfig__CatalogDBType: SQLite
SGS__ServerConfig__SharedDataPath: /app/data/SkylineGlobeServerConfiguration
SGS__ServerConfig__PublicUrl: http://localhost:5000
SGS__ServerConfig__LicenseServerURL: ""
volumes: # Mount local folders for data persistence
- ./data:/app/data
- ./config:/app/config
# Option 1: Mount a subfolder (keeps the original /app/tef/custom contents)
# - ./more-data:/app/tef/custom/more-data
# Option 2: Mount a single file (adds/replaces one file). ":ro" makes the mount read-only
# - ./my-config.json:/app/tef/custom/my-config.json:ro
networks:
- skyline_network
networks:
skyline_network:
driver: bridgeSQLite + NGINX (HTTPS)
services:
nginx:
image: nginx:latest
container_name: nginx_proxy
restart: always
depends_on:
- skylineglobeserver
ports:
- "8443:443" # External 8443 maps to internal NGINX HTTPS port 443
volumes: # Mount local folders for data persistence
- ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro
- ./nginx/certs:/etc/nginx/certs:ro
networks:
- skyline_network
skylineglobeserver:
image: skylineglobe/skylineglobeserver:latest # Docker image to use
container_name: skylineglobeserver
restart: always
expose:
- "5155" # Expose for internal use
environment: # Configure SGS
SGS__ServerConfig__CatalogDBType: SQLite
SGS__ServerConfig__SharedDataPath: /app/data/SkylineGlobeServerConfiguration
SGS__ServerConfig__PublicUrl: https://sgs.localhost:8443
SGS__ServerConfig__LicenseServerURL: ""
SGS__Kestrel__Endpoints__Http__Url: http://0.0.0.0:5155
volumes: # Mount local folders for data persistence
- ./data:/app/data
- ./config:/app/config
# Option 1: Mount a subfolder (keeps the original /app/tef/custom contents)
# - ./more-data:/app/tef/custom/more-data
# Option 2: Mount a single file (adds/replaces one file). ":ro" makes the mount read-only
# - ./my-config.json:/app/tef/custom/my-config.json:ro
networks:
- skyline_network
networks:
skyline_network:
driver: bridgePostgreSQL + NGINX (HTTPS)
services:
nginx:
image: nginx:latest
container_name: nginx_proxy
restart: always
depends_on:
- skylineglobeserver
ports:
- "8443:443" # External 8443 maps to internal NGINX HTTPS port 443
volumes: # Mount local folders for data persistence
- ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro
- ./nginx/certs:/etc/nginx/certs:ro
networks:
- skyline_network
postgres:
image: postgis/postgis:latest
container_name: postgres_for_sgs
restart: always
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: postgres
ports:
- "5433:5432"
volumes:
- ./postgres_data:/var/lib/postgresql/data
networks:
- skyline_network
healthcheck:
test: ["CMD-SHELL", "pg_isready -h postgres -U postgres -d postgres"]
interval: 10s
retries: 20
start_period: 120s
start_interval: 2s
timeout: 10s
skylineglobeserver:
image: skylineglobe/skylineglobeserver:latest # Docker image to use
container_name: skylineglobeserver
restart: always
depends_on:
postgres:
condition: service_healthy
expose:
- "5155" # Expose for internal use
environment: # Configure SGS
DB_HOST: postgres
DB_USER: postgres
DB_PASSWORD: postgres
DB_NAME: postgres
SGS__ServerConfig__CatalogDBType: PostgreSQL
SGS__ServerConfig__SharedDataPath: /app/data/SkylineGlobeServerConfiguration
SGS__ServerConfig__CatalogPostgreSqlConnString: server=postgres;port=5432;user id=postgres;password=postgres;
SGS__ServerConfig__PublicUrl: https://sgs.localhost:8443
SGS__ServerConfig__LicenseServerURL: ""
SGS__Kestrel__Endpoints__Http__Url: http://0.0.0.0:5155
SGS__AllowedHosts: "*"
volumes: # Mount local folders for data persistence
- ./data:/app/data
- ./config:/app/config
# Option 1: Mount a subfolder (keeps the original /app/tef/custom contents)
# - ./more-data:/app/tef/custom/more-data
# Option 2: Mount a single file (adds/replaces one file). ":ro" makes the mount read-only
# - ./my-config.json:/app/tef/custom/my-config.json:ro
networks:
- skyline_network
networks:
skyline_network:
driver: bridgeKubernetes
Basic SQLite (HTTP)
deployment.yaml file
apiVersion: apps/v1
kind: Deployment
metadata:
name: sgs-app-deployment
spec:
replicas: 2
selector:
matchLabels:
app: sgs-app
template:
metadata:
labels:
app: sgs-app
spec:
imagePullSecrets:
- name: my-dockerhub-secret
containers:
- name: sgs-app
image: skylineglobe/skylineglobeserver:latest
imagePullPolicy: Always
ports:
- containerPort: 5155
env:
- name: SGS__ServerConfig__CatalogDBType
value: SQLite
- name: SGS__ServerConfig__SharedDataPath
value: /app/data
- name: SGS__ServerConfig__PublicUrl
value: http://localhost:30080
- name: SGS__ServerConfig__LicenseServerURL
value: ""
volumeMounts:
- name: config-volume
mountPath: /app/config
- name: data-volume
mountPath: /app/data
# -----------------------------------------------------
# Option 1: Mount a subfolder (keeps the original /app/tef/custom contents)
# -----------------------------------------------------
#- name: more-data-volume
# mountPath: /app/tef/custom/more-data
# -----------------------------------------------------
# Option 2: Mount a single file (adds/replaces one file).
# The "readOnly: true" field is the equivalent of ":ro" in Docker.
# -----------------------------------------------------
#- name: custom-file-volume
# mountPath: /app/tef/custom/my-config.json
# subPath: my-config.json
# readOnly: true
volumes:
- name: config-volume
hostPath:
path: "/run/desktop/mnt/host/c/sgs/config"
- name: data-volume
hostPath:
path: "/run/desktop/mnt/host/c/sgs/data"
# -----------------------------------------------------
# Option 1: Host folder to mount as a subfolder inside the container
# -----------------------------------------------------
#- name: more-data-volume
# hostPath:
# path: "/run/desktop/mnt/host/c/sgs/more-data"
# -----------------------------------------------------
# Option 2: Host file to mount as read-only
# -----------------------------------------------------
#- name: custom-file-volume
# hostPath:
# path: "/run/desktop/mnt/host/c/sgs/custom/myconfig.json"service.yaml file
apiVersion: v1
kind: Service
metadata:
name: sgs-app-service
spec:
type: NodePort
selector:
app: sgs-app
ports:
- port: 80
targetPort: 5155
nodePort: 30080SQLite + Ingress (HTTPS)
deployment.yaml file
apiVersion: apps/v1
kind: Deployment
metadata:
name: sgs-app-deployment
spec:
replicas: 2
selector:
matchLabels:
app: sgs-app
template:
metadata:
labels:
app: sgs-app
spec:
imagePullSecrets:
- name: my-dockerhub-secret
containers:
- name: sgs-app
image: skylineglobe/skylineglobeserver:latest
imagePullPolicy: Always
ports:
- containerPort: 5155
env:
- name: SGS__ServerConfig__CatalogDBType
value: SQLite
- name: SGS__ServerConfig__SharedDataPath
value: /app/data
- name: SGS__ServerConfig__PublicUrl
value: https://sgs.localhost
- name: SGS__ServerConfig__LicenseServerURL
value: ""
- name: SGS__Kestrel__Endpoints__Http__Url
value: http://0.0.0.0:5155
- name: SGS__AllowedHosts
value: "*"
volumeMounts:
- name: config-volume
mountPath: /app/config
- name: data-volume
mountPath: /app/data
# -----------------------------------------------------
# Option 1: Mount a subfolder (keeps the original /app/tef/custom contents)
# -----------------------------------------------------
#- name: more-data-volume
# mountPath: /app/tef/custom/more-data
# -----------------------------------------------------
# Option 2: Mount a single file (adds/replaces one file).
# The "readOnly: true" field is the equivalent of ":ro" in Docker.
# -----------------------------------------------------
#- name: custom-file-volume
# mountPath: /app/tef/custom/my-config.json
# subPath: my-config.json
# readOnly: true
volumes:
- name: config-volume
hostPath:
path: "/run/desktop/mnt/host/c/sgs/config"
- name: data-volume
hostPath:
path: "/run/desktop/mnt/host/c/sgs/data"
# -----------------------------------------------------
# Option 1: Host folder to mount as a subfolder inside the container
# -----------------------------------------------------
#- name: more-data-volume
# hostPath:
# path: "/run/desktop/mnt/host/c/sgs/more-data"
# -----------------------------------------------------
# Option 2: Host file to mount as read-only
# -----------------------------------------------------
#- name: custom-file-volume
# hostPath:
# path: "/run/desktop/mnt/host/c/sgs/custom/myconfig.json"service.yaml file
apiVersion: v1
kind: Service
metadata:
name: sgs-app-service
spec:
type: ClusterIP
selector:
app: sgs-app
ports:
- name: http
port: 80
targetPort: 5155ingress.yaml file
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: sgs-ingress
annotations:
nginx.ingress.kubernetes.io/ssl-redirect: "true"
nginx.ingress.kubernetes.io/proxy-body-size: "0"
spec:
ingressClassName: nginx
tls:
- hosts:
- sgs.localhost
secretName: sgs-tls-secret
rules:
- host: sgs.localhost
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: sgs-app-service
port:
number: 80PostgreSQL + Ingress (HTTPS)
postgres-deployment.yaml file
apiVersion: apps/v1
kind: Deployment
metadata:
name: postgres
spec:
replicas: 1
selector:
matchLabels:
app: postgres
template:
metadata:
labels:
app: postgres
spec:
containers:
- name: postgres
image: postgis/postgis:latest
ports:
- containerPort: 5432
env:
- name: POSTGRES_USER
value: postgres
- name: POSTGRES_PASSWORD
value: postgres
- name: POSTGRES_DB
value: postgres
volumeMounts:
- name: pgdata
mountPath: /var/lib/postgresql/data
volumes:
- name: pgdata
hostPath:
path: /run/desktop/mnt/host/c/sgs/postgres_data
type: DirectoryOrCreate postgres-service.yaml file
apiVersion: v1
kind: Service
metadata:
name: postgres
spec:
type: NodePort
selector:
app: postgres
ports:
- port: 5432
targetPort: 5432
nodePort: 31432deployment.yaml file
apiVersion: apps/v1
kind: Deployment
metadata:
name: sgs-app-deployment
spec:
replicas: 2
selector:
matchLabels:
app: sgs-app
template:
metadata:
labels:
app: sgs-app
spec:
imagePullSecrets:
- name: my-dockerhub-secret
containers:
- name: sgs-app
image: skylineglobe/skylineglobeserver:latest
imagePullPolicy: Always
ports:
- containerPort: 5155
env:
- name: SGS__ServerConfig__CatalogDBType
value: PostgreSQL
- name: SGS__ServerConfig__CatalogPostgreSqlConnString
value: server=postgres;port=5432;user id=postgres;password=postgres;
- name: SGS__ServerConfig__SharedDataPath
value: /app/data
- name: SGS__ServerConfig__PublicUrl
value: https://sgs.localhost
- name: SGS__ServerConfig__LicenseServerURL
value: ""
- name: SGS__Kestrel__Endpoints__Http__Url
value: http://0.0.0.0:5155
- name: SGS__AllowedHosts
value: "*"
volumeMounts:
- name: config-volume
mountPath: /app/config
- name: data-volume
mountPath: /app/data
# -----------------------------------------------------
# Option 1: Mount a subfolder (keeps the original /app/tef/custom contents)
# -----------------------------------------------------
#- name: more-data-volume
# mountPath: /app/tef/custom/more-data
# -----------------------------------------------------
# Option 2: Mount a single file (adds/replaces one file).
# The "readOnly: true" field is the equivalent of ":ro" in Docker.
# -----------------------------------------------------
#- name: custom-file-volume
# mountPath: /app/tef/custom/my-config.json
# subPath: my-config.json
# readOnly: true
volumes:
- name: config-volume
hostPath:
path: "/run/desktop/mnt/host/c/sgs/config"
- name: data-volume
hostPath:
path: "/run/desktop/mnt/host/c/sgs/data"
# -----------------------------------------------------
# Option 1: Host folder to mount as a subfolder inside the container
# -----------------------------------------------------
#- name: more-data-volume
# hostPath:
# path: "/run/desktop/mnt/host/c/sgs/more-data"
# -----------------------------------------------------
# Option 2: Host file to mount as read-only
# -----------------------------------------------------
#- name: custom-file-volume
# hostPath:
# path: "/run/desktop/mnt/host/c/sgs/custom/myconfig.json"service.yaml file
apiVersion: v1
kind: Service
metadata:
name: sgs-app-service
spec:
type: ClusterIP
selector:
app: sgs-app
ports:
- name: http
port: 80
targetPort: 5155ingress.yaml file
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: sgs-ingress
annotations:
nginx.ingress.kubernetes.io/ssl-redirect: "true"
nginx.ingress.kubernetes.io/proxy-body-size: "0"
spec:
ingressClassName: nginx
tls:
- hosts:
- sgs.localhost
secretName: sgs-tls-secret
rules:
- host: sgs.localhost
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: sgs-app-service
port:
number: 80