24 changed files with 298 additions and 163 deletions
-
2.editorconfig
-
4.gitlab-ci.yml
-
14Makefile
-
8devops/docker/Dockerfile
-
1devops/k8s/0_ConfigMap/.gitignore
-
55devops/k8s/0_ConfigMap/nginx-dev.yaml
-
1devops/k8s/0_Secret/.gitignore
-
22devops/k8s/1_Service/nginx.yaml
-
87devops/k8s/2_Deployment/notification-provider.yaml
-
40docker-compose-local.yml
-
19docker-compose.yml
@ -1,18 +1,12 @@ |
|||
MAKEFLAGS += --silent |
|||
.PHONY: * |
|||
|
|||
restart-local: |
|||
docker-compose -f docker-compose-local.yml pull |
|||
docker-compose -f docker-compose-local.yml down |
|||
docker-compose -f docker-compose-local.yml up -d --build |
|||
apply: |
|||
kubectl apply --recursive=true --filename=devops/k8s |
|||
|
|||
restart: |
|||
docker-compose -f docker-compose.yml pull |
|||
docker-compose -f docker-compose.yml down |
|||
docker-compose -f docker-compose.yml up -d |
|||
docker-compose -f docker-compose.yml up -d --build |
|||
|
|||
cleanup: |
|||
docker system prune --all --force |
|||
docker system prune --volumes --force |
|||
|
|||
.DEFAULT_GOAL := restart |
|||
.DEFAULT_GOAL := apply |
@ -0,0 +1 @@ |
|||
app-dev.yml |
@ -0,0 +1,55 @@ |
|||
--- |
|||
apiVersion: v1 |
|||
kind: ConfigMap |
|||
metadata: |
|||
name: notification-provider-nginx-configmap0-dev |
|||
namespace: default |
|||
labels: |
|||
tier: notification-provider |
|||
component: nginx |
|||
environment: dev |
|||
data: |
|||
default.conf: | |
|||
server { |
|||
root /var/www/localhost/public; |
|||
error_log /var/log/nginx/localhost-error.log; |
|||
access_log /var/log/nginx/localhost-access.log; |
|||
|
|||
location / { |
|||
try_files $uri /index.php$is_args$args; |
|||
} |
|||
|
|||
location ~ \.php { |
|||
fastcgi_split_path_info ^(.+\.php)(/.+)$; |
|||
fastcgi_pass 127.0.0.1:9000; |
|||
include fastcgi_params; |
|||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; |
|||
fastcgi_param DOCUMENT_ROOT $document_root; |
|||
internal; |
|||
} |
|||
location ~ \.php$ { |
|||
return 404; |
|||
} |
|||
} |
|||
nginx.conf: | |
|||
user nginx; |
|||
worker_processes auto; |
|||
error_log /var/log/nginx/error.log warn; |
|||
pid /var/run/nginx.pid; |
|||
events { |
|||
worker_connections 1024; |
|||
} |
|||
http { |
|||
include /etc/nginx/mime.types; |
|||
default_type application/octet-stream; |
|||
log_format main '$remote_addr - $remote_user [$time_local] "$request" ' |
|||
'$status $body_bytes_sent "$http_referer" ' |
|||
'"$http_user_agent" "$http_x_forwarded_for"'; |
|||
access_log /var/log/nginx/access.log main; |
|||
sendfile on; |
|||
#tcp_nopush on; |
|||
keepalive_timeout 65; |
|||
#gzip on; |
|||
include /etc/nginx/conf.d/default.conf; |
|||
} |
|||
... |
@ -0,0 +1 @@ |
|||
gitlab-docker.yaml |
@ -0,0 +1,22 @@ |
|||
--- |
|||
apiVersion: v1 |
|||
kind: Service |
|||
metadata: |
|||
name: notification-provider-nginx-service-dev |
|||
namespace: default |
|||
labels: |
|||
tier: notification-provider |
|||
component: nginx |
|||
environment: dev |
|||
spec: |
|||
selector: |
|||
app: notification-provider |
|||
tier: notification-provider |
|||
type: NodePort |
|||
ports: |
|||
- name: http |
|||
protocol: TCP |
|||
port: 80 |
|||
targetPort: 80 |
|||
nodePort: 30036 |
|||
... |
@ -0,0 +1,87 @@ |
|||
--- |
|||
apiVersion: apps/v1 |
|||
kind: Deployment |
|||
metadata: |
|||
name: notification-provider |
|||
namespace: default |
|||
labels: |
|||
tier: notification-provider |
|||
environment: dev |
|||
spec: |
|||
replicas: 1 |
|||
selector: |
|||
matchLabels: |
|||
app: notification-provider |
|||
tier: notification-provider |
|||
strategy: |
|||
rollingUpdate: |
|||
maxSurge: 1 |
|||
maxUnavailable: 0 |
|||
type: RollingUpdate |
|||
template: |
|||
metadata: |
|||
labels: |
|||
app: notification-provider |
|||
tier: notification-provider |
|||
spec: |
|||
volumes: |
|||
- name: shared-files |
|||
emptyDir: { } |
|||
- name: notification-provider-app-configmap0-dev |
|||
configMap: |
|||
defaultMode: 0664 |
|||
name: notification-provider-app-configmap0-dev |
|||
- name: notification-provider-nginx-configmap0-dev |
|||
configMap: |
|||
defaultMode: 0664 |
|||
name: notification-provider-nginx-configmap0-dev |
|||
containers: |
|||
- name: php |
|||
image: gitlab-registry.fedy95.com:5002/dev/notification-provider:latest |
|||
resources: |
|||
requests: |
|||
cpu: "125m" |
|||
memory: "64Mi" |
|||
limits: |
|||
cpu: "250m" |
|||
memory: "128Mi" |
|||
volumeMounts: |
|||
- name: shared-files |
|||
mountPath: /var/www/localhost |
|||
- name: notification-provider-app-configmap0-dev |
|||
mountPath: /var/www/localhost/.env |
|||
subPath: .env |
|||
lifecycle: |
|||
postStart: |
|||
exec: |
|||
command: |
|||
- "/bin/sh" |
|||
- "-c" |
|||
- > |
|||
cp -rp /app/* /var/www/localhost |
|||
|
|||
- name: nginx |
|||
image: nginx:1.21-alpine |
|||
resources: |
|||
requests: |
|||
cpu: "125m" |
|||
memory: "64Mi" |
|||
limits: |
|||
cpu: "250m" |
|||
memory: "128Mi" |
|||
volumeMounts: |
|||
- name: shared-files |
|||
mountPath: /var/www/localhost |
|||
- name: notification-provider-app-configmap0-dev |
|||
mountPath: /var/www/localhost/.env |
|||
subPath: .env |
|||
- name: notification-provider-nginx-configmap0-dev |
|||
mountPath: /etc/nginx/nginx.conf |
|||
subPath: nginx.conf |
|||
- name: notification-provider-nginx-configmap0-dev |
|||
mountPath: /etc/nginx/conf.d/default.conf |
|||
subPath: default.conf |
|||
restartPolicy: Always |
|||
imagePullSecrets: |
|||
- name: gitlab-docker |
|||
... |
@ -1,40 +0,0 @@ |
|||
--- |
|||
version: "3.4" |
|||
|
|||
networks: |
|||
monitoring_monitor-net: |
|||
external: true |
|||
|
|||
services: |
|||
app: |
|||
build: |
|||
context: . |
|||
dockerfile: devops/docker/php/Dockerfile |
|||
target: local |
|||
restart: always |
|||
|
|||
environment: |
|||
COMPOSER_MEMORY_LIMIT: "-1" |
|||
PHP_IDE_CONFIG: "serverName=notification-provider_app" |
|||
volumes: |
|||
- ${HOME}/.composer:${HOME}/.composer |
|||
- ./app:/var/www/localhost |
|||
expose: |
|||
- "9000" |
|||
networks: |
|||
- monitoring_monitor-net |
|||
|
|||
nginx: |
|||
image: nginx:1.21-alpine |
|||
restart: always |
|||
|
|||
depends_on: |
|||
- app |
|||
volumes: |
|||
- ./app:/var/www/localhost |
|||
- ./devops/docker/nginx/etc/nginx/conf.d/default.conf:/etc/nginx/conf.d/default.conf |
|||
ports: |
|||
- "8054:80" |
|||
networks: |
|||
- monitoring_monitor-net |
|||
... |
Write
Preview
Loading…
Cancel
Save
Reference in new issue