@azole 461 Followers 🕴 👉 Docker Container 基礎入門篇 1 👏 1883 👉 [WebConf2023] Docker 入門 101 👏 249 👉 從鐵人完賽到書籍書版 👏 140
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
service: laravel | |
provider: | |
name: aws | |
# The AWS region in which to deploy (us-east-1 is the default) | |
region: ap-northeast-1 | |
# The stage of the application, e.g. dev, production, staging… ('dev' is the default) | |
stage: dev | |
runtime: provided.al2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
service: app | |
provider: | |
name: aws | |
region: ap-northeast-1 # 改成自己想要部署的 region | |
runtime: provided.al2 | |
plugins: | |
- ./vendor/bref/bref |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let doWorkPromise = function (job, timer, success) { | |
return new Promise((resolve, reject) => { | |
setTimeout(() => { | |
let dt = new Date(); | |
if (success) { | |
// 成功 | |
return resolve(`完成工作: ${job} at ${dt.toISOString()}`); | |
} | |
reject(`!!工作失敗: ${job} at ${dt.toISOString()}`); | |
}, timer); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// 0.0.0.0 表示監聽所有 IP 地址 | |
$http = new Swoole\Http\Server('0.0.0.0', 9501); | |
$http->set([ | |
// 可以 host static files | |
// 但不建議這樣做,靜態檔案還是讓 nginx 來 | |
'enable_static_handler' => true, | |
// 'http_autoindex' => false, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt-get update | |
sudo apt-get install nginx -y | |
sudo apt-get install php7.4-fpm php7.4-cli php7.4-gd php7.4-mysql php7.4-xml php7.4-mbstring -y | |
# edit /etc/php/7.4/fpm/php.ini | |
sudo nano /etc/php/7.4/fpm/php.ini | |
# uncomment cgi.fix_pathinfo and set the value to "0" | |
sudo nano /etc/nginx/sites-available/default | |
# uncomment ~\.php section and modify as followed: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fs = require('fs'); | |
const writeFile = async (data, fileName) => { | |
// 你要寫的部分 | |
return new Promise((resolve, reject) => { | |
fs.writeFile(fileName, data, (err) => { | |
if (err) { | |
reject(err); | |
} | |
resolve(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const argon2 = require('argon2'); | |
let plainPasswords = ['asdfwrwsdf', 'aserqwr&134sfasefr', 'asfw423d', 'asf8w4@w3423', 'qqsfw40#sjr#', 'PassW0rd', 'administartor']; | |
let len = plainPasswords.length; | |
let hashedPassword = []; | |
async function argon2Hash(count) { | |
console.time('argon2'); | |
for (let i = 0; i < count; i++) { | |
const hash = await argon2.hash(plainPasswords[i % len], 10); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
services: | |
mongo: | |
image: mongo:6.0 | |
container_name: mongo | |
networks: | |
- graylog | |
restart: unless-stopped | |
opensearch: | |
image: opensearchproject/opensearch:2.4.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
services: | |
prometheus: | |
image: prom/prometheus:latest | |
container_name: prometheus | |
volumes: | |
- ./prometheus.yml:/etc/prometheus/prometheus.yml | |
- prometheus_data:/prometheus | |
ports: | |
- "9090:9090" |
OlderNewer