初始化仓库;提供php和tsdb开发环境配置
This commit is contained in:
38
Dockerfile
Normal file
38
Dockerfile
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
FROM ubuntu:22.04
|
||||||
|
|
||||||
|
ARG DEBIAN_FRONTEND=noninteractive
|
||||||
|
ENV TZ=Asia/Shanghai
|
||||||
|
# https://serverfault.com/a/683651
|
||||||
|
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
|
||||||
|
|
||||||
|
RUN sed -i 's/archive.ubuntu.com/mirrors.ustc.edu.cn/g' /etc/apt/sources.list \
|
||||||
|
&& apt update \
|
||||||
|
&& apt install -y software-properties-common \
|
||||||
|
&& add-apt-repository -y ppa:ondrej/php \
|
||||||
|
&& sed -i 's/ppa.launchpad.net/launchpad.proxy.ustclug.org/g' /etc/apt/sources.list.d/ondrej-ubuntu-php-jammy.list \
|
||||||
|
&& apt update \
|
||||||
|
&& apt install -y --no-install-recommends \
|
||||||
|
make \
|
||||||
|
curl \
|
||||||
|
php \
|
||||||
|
php-pear \
|
||||||
|
php-dev \
|
||||||
|
php-curl \
|
||||||
|
php-xdebug \
|
||||||
|
php-mbstring \
|
||||||
|
php-xml \
|
||||||
|
libevent-dev \
|
||||||
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
RUN printf "\n\n\n\n\nno\nyes\n\n" | pecl install event \
|
||||||
|
&& printf "; priority=30\nextension=event.so\n" > /etc/php/$(ls /etc/php/)/mods-available/event.ini \
|
||||||
|
&& phpenmod -v $(ls /etc/php/) event \
|
||||||
|
&& curl -s https://mirrors.aliyun.com/composer/composer.phar -o /usr/local/bin/composer \
|
||||||
|
&& chmod +x /usr/local/bin/composer \
|
||||||
|
&& composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/
|
||||||
|
|
||||||
|
COPY . /SCADA
|
||||||
|
|
||||||
|
WORKDIR /SCADA
|
||||||
|
|
||||||
|
RUN composer install
|
||||||
23
REAMDE.md
Normal file
23
REAMDE.md
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
# SCADA
|
||||||
|
|
||||||
|
## 开发环境
|
||||||
|
|
||||||
|
拉取代码:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# 建议先配置SSH key pair
|
||||||
|
git clone ssh://git@118.195.187.246:10022/ysun/SCADA.git
|
||||||
|
cd SCADA
|
||||||
|
```
|
||||||
|
|
||||||
|
一键部署PHP workerman和TimescaleDB环境:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
docker compose up -d
|
||||||
|
```
|
||||||
|
|
||||||
|
进入交互式Prompt:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
docker exec -it scada bash
|
||||||
|
```
|
||||||
13
composer.json
Normal file
13
composer.json
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
{
|
||||||
|
"require": {
|
||||||
|
"workerman/workerman": "^4.0",
|
||||||
|
},
|
||||||
|
"require-dev": {
|
||||||
|
"codeception/codeception": "^4.1",
|
||||||
|
"codeception/module-phpbrowser": "^1.0.0",
|
||||||
|
"codeception/module-asserts": "^1.0.0",
|
||||||
|
"codeception/module-db": "^2.0",
|
||||||
|
"codeception/verify": "^2.2",
|
||||||
|
"symfony/var-dumper": "^5.4"
|
||||||
|
}
|
||||||
|
}
|
||||||
17
docker-compose.yml
Normal file
17
docker-compose.yml
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
services:
|
||||||
|
scada:
|
||||||
|
container_name: scada
|
||||||
|
build:
|
||||||
|
context: .
|
||||||
|
network_mode: "host"
|
||||||
|
volumes:
|
||||||
|
- $PWD:/SCADA
|
||||||
|
restart: unless-stopped
|
||||||
|
|
||||||
|
timescaledb:
|
||||||
|
container_name: tsdb
|
||||||
|
image: timescale/timescaledb-ha:pg14-latest
|
||||||
|
network_mode: "host"
|
||||||
|
restart: unless-stopped
|
||||||
|
environment:
|
||||||
|
POSTGRES_PASSWORD: big_dick
|
||||||
Reference in New Issue
Block a user