apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    io.kompose.service: backend
  name: backend
spec:
  replicas: 1
  selector:
    matchLabels:
      io.kompose.service: backend
  template:
    metadata:
      labels:
        io.kompose.service: backend
    spec:
      containers:
        - env:
            - name: SPRING_DATASOURCE_PASSWORD
              value: "12345"
            - name: SPRING_DATASOURCE_URL
              value: jdbc:postgresql://db:5432/bricoly
            - name: SPRING_DATASOURCE_USERNAME
              value: bricoly
            - name: SPRING_JPA_HIBERNATE_DDL_AUTO
              value: create-drop
          image: ignema/bricoly-backend
          name: bricoly-backend
          ports:
            - containerPort: 8080
          resources: 
            limits:
              cpu: 100m
              memory: 100Mi
            requests:
              cpu: 100m
              memory: 100Mi
      restartPolicy: Always