[root@dockerserver ~]mkdir snipeit [root@dockerserver ~]cd snipeit
################################################# services: app: image: snipe/snipe-it:${APP_VERSION:-latest} restart: unless-stopped #docker sẽ tự tạo và quản lý. Dữ liệu không mất kể cả xóa image và container. volumes: - storage:/var/lib/snipeit ports: - "${APP_PORT:-80}:80" env_file: - .env volumes: storage: #################################################
[root@dockerserver ~]docker compose run --rm app php artisan key:generate --show Thông tin output sẽ điền vào APP_KEY trong file .env
################################################# # -------------------------------------------- # REQUIRED: DOCKER SPECIFIC SETTINGS # -------------------------------------------- APP_VERSION= APP_PORT=80 # -------------------------------------------- # REQUIRED: BASIC APP SETTINGS # -------------------------------------------- APP_ENV=production APP_DEBUG=false # Please regenerate the APP_KEY value by calling `docker compose run --rm app php artisan key:generate --show`. Copy paste the value here APP_KEY=base64:điền app_key vào đây APP_URL=http://10.128.59.30 # https://en.wikipedia.org/wiki/List_of_tz_database_time_zones - TZ identifier APP_TIMEZONE='UTC' APP_LOCALE=en-US MAX_RESULTS=500 # -------------------------------------------- # REQUIRED: UPLOADED FILE STORAGE SETTINGS # -------------------------------------------- PRIVATE_FILESYSTEM_DISK=local PUBLIC_FILESYSTEM_DISK=local_public # -------------------------------------------- # REQUIRED: DATABASE SETTINGS # -------------------------------------------- DB_HOST=10.128.59.200 DB_PORT='3306' DB_DATABASE=snipeit DB_USERNAME=snipeuser DB_PASSWORD=It12345! # -------------------------------------------- # OPTIONAL: SSL DATABASE SETTINGS # -------------------------------------------- DB_SSL=false DB_SSL_IS_PAAS=false DB_SSL_KEY_PATH=null DB_SSL_CERT_PATH=null DB_SSL_CA_PATH=null DB_SSL_CIPHER=null DB_SSL_VERIFY_SERVER=null # -------------------------------------------- # REQUIRED: OUTGOING MAIL SERVER SETTINGS # -------------------------------------------- MAIL_MAILER=smtp MAIL_HOST=mailhog MAIL_PORT=1025 MAIL_USERNAME=null MAIL_PASSWORD=null MAIL_TLS_VERIFY_PEER=true MAIL_FROM_ADDR=you@example.com MAIL_FROM_NAME='Snipe-IT' MAIL_REPLYTO_ADDR=you@example.com MAIL_REPLYTO_NAME='Snipe-IT' MAIL_AUTO_EMBED_METHOD='attachment' #################################################
create database snipeit character set utf8mb4 collate utf8mb4_general_ci; #Tạo user (giới hạn chỉ từ ip của host chạy redmine nếu muốn) create user 'snipeuser'@'%' identified by 'strongp@ssw0rd!'; #Cấp quyền grant all privileges on snipeit.* to 'snipeuser'@'%'; flush privileges;
[root@dockerserver ~]docker compose up -d
|
