Skip to main content

generale

NomenclaturaContainer containerNaming

ilThe nomename dovrebbeshould esserebe univoco,univocal, in modoorder dato esserebe immediatamenteimmediately identificabile,identifiable, megliobetter mettereto ilput nomethe delname progetto,of l'ambientethe project, the environment (dev, coll, prod, prelive, ecc)etc.)

preferibilmente:preferably: <nometeamteamname>-<nomeprogettoprojectname>-<nomeservizioservicename>-<ambienteenv>

esempioexample

  web-app:
    image: gitlab-registry.eagleprojects.cloud/python/rpa/rpa-1942_webapp_hr:latest-dev
    restart: unless-stopped
    container_name: rpa-hr-web-app-dev  <-- OK!
    ports:
      - '24406:8000'
    volumes:
      - ./shared-data:/app/downloads
    env_file:
      - .env
    depends_on:
      - redis
      - db
    environment:
      - "TZ=Europe/Rome"
    labels:
      - 'com.centurylinklabs.watchtower.enable=true'
      - "cloud.eagleprojects.autocd.enable=true"

  web-app:
    image: gitlab-registry.eagleprojects.cloud/python/rpa/rpa-1942_webapp_hr:latest-dev
    restart: unless-stopped
    container_name: web-app <-- NONNOT OK!GOOD!
    ports:
      - '24406:8000'
    volumes:
      - ./shared-data:/app/downloads
    env_file:
      - .env
    depends_on:
      - redis
      - db
    environment:
      - "TZ=Europe/Rome"
    labels:
      - 'com.centurylinklabs.watchtower.enable=true'
      - "cloud.eagleprojects.autocd.enable=true"

PortePorts

sarebbeIt benewould utilizzarebe portegood espsteto sull'use doors on display on the host (quinditherefore ports, nonnot expose)exposure) superiorigreater allathan 23000 eand inferiorilower allathan the 65000 incluseincluded

esempioexample

  web-app:
    image: gitlab-registry.eagleprojects.cloud/python/rpa/rpa-1942_webapp_hr:latest-dev
    restart: unless-stopped
    container_name: hr-web-app-dev
    ports:           <--
      - '24406:8000' <-- OK!
    volumes:
      - ./shared-data:/app/downloads
    env_file:
      - .env
    depends_on:
      - redis
      - db
    environment:
      - "TZ=Europe/Rome"
    labels:
      - 'com.centurylinklabs.watchtower.enable=true'

Timezone

ÈIt importanteis mettereimportant ancheto laalso put the timezone comeas environment,Environment, comeas negliin esempithe sopraexamples above

Healthcheck

doveWhere possibilepossible aggiungereto unadd healthchecka Healthcheck

    healthcheck:
      test: ["CMD-SHELL", "curl localhost:8080"]
      interval: "10s"
      timeout: "30s"
      retries: 5
      start_period: "20s"

Password

leThe passwordpasswords dovewhere possibilepossible devonomust esserebe piùlonger lunghe dithan 16 caratteri,characters, alin fineorder dito evitareavoid incompatibilitàincompatibility conwith alcunisome sistemisystems sarebbeit benewould usarebe sologood numerito euse lettere,only quindinumbers meglioand evitareletters, simboli,therefore sebetter proprioto èavoid indispensabilesymbols, usareif simboliit comunqueis evitareessential categoricamenteto iuse caratteri:symbols in any case categorically avoid characters: # @ ! & ; / > < % *

Env

PerAs quantofor riguardathe inames nomiof deiEnv files, the standard agreement is the following. If only one ENV file dimust env,be la convenzione standard è la seguente.
Se è necessario un solo file di env si dovrà chiamarecalled .env. NelIn casothe dicase piùof filemultiple files (perfor esempioexample perto fornireprovide lthe credenzialiaccess d'accessocredentials alto the DB alto solothe BE)BE only), allorathen ithe filefiles siwill chiamerannobe called

oor

.env-be .env-fe .env-db ecc

oor

.env-<servizio> es: .env-postgres_16 .env-redis_lts

LaThe primafirst nomencalaturanomenclature èis preferibile.preferable. aRegardless prescindereof ithe fileENV difiles, envthey dovrannomust trovarsibe nelloin stessothe livellosame dellevel docker-compose.as Docker-comparison.

├── depa-fe-asset
│   ├── config.conf
│   └── img
│       └── test.png
├── docker-compose.yaml   <--------
├── .env-be                <--------
└── .env-fe                <--------