27.02.2026, 18:49. Показов 356. Ответов 0
Frontend работает открывается,adminer работает но Sequelize не может создать таблицы в базе
Уже спрашивал в родном форуме docker ничего путного не ответили подскажите где копать?
Вот docker compose yml
| Code |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
| services:
frontend:
build: C:/docker/reactApp/client/
ports:
- '3333:3000'
backend:
build: C:/docker/reactApp/server/
environment:
DB_HOST: mysql # тут указывайте имя сервиса
DB_PORT: 3306
DB_NAME: online_store
DB_USER: root
DB_PASSWORD: password
depends_on:
- mysql
ports:
- '5555:5000'
mysql:
image: mysql:8.4
environment:
MYSQL_ROOT_PASSWORD: password
MYSQL_DATABASE: online_store
ports:
- "3306:3306"
volumes:
- mysql_data:/var/lib/mysql
adminer:
image: adminer
depends_on:
- mysql
ports:
- '8888:8080'
volumes:
mysql_data: |
|
Dockerfileы нормальные вот сам сайт там в файл .env поменял хост бд на mysql, порт 3306 и пароль на password, user root, в файле db поменял диалект на mysql и добавил 2 плагина в srver package.jso mysql и mysql2, вот исходник
https://github.com/utimur/online-store-full-course
| Code |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
| mysql-1 | 2026-02-24T18:51:37.258691Z 0 [System] [MY-015017] [Server] MySQL Server Initialization - start.
mysql-1 | 2026-02-24T18:51:37.263526Z 0 [System] [MY-013169] [Server] /usr/sbin/mysqld (mysqld 8.4.8) initializing of server in progress as process 80
mysql-1 | 2026-02-24T18:51:37.289808Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
frontend-1 |
backend-1 frontend-1 | > client@0.1.0 startConfig w Enable Watch d Detach
backend-1 | > server@1.0.0 dev
frontend-1 | > react-scripts start
backend-1 | > nodemon index.js
frontend-1 |
backend-1 |
mysql-1 | 2026-02-24T18:51:38.366965Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
backend-1 | [nodemon] 2.0.7
backend-1 | [nodemon] to restart at any time, enter `rs`
backend-1 | [nodemon] watching path(s): *.*
backend-1 | [nodemon] watching extensions: js,mjs,json
backend-1 | [nodemon] starting `node index.js`
mysql-1 | 2026-02-24T18:51:41.730882Z 6 [Warning] [MY-010453] [Server] root@localhost is created with an empty password ! Please consider switching off the --initialize-insecure option.
backend-1 | ConnectionRefusedError [SequelizeConnectionRefusedError]: connect ECONNREFUSED 172.18.0.2:3306
backend-1 | at ConnectionManager.connect (/app/node_modules/sequelize/lib/dialects/mysql/connection-manager.js:92:17)
backend-1 | at processTicksAndRejections (node:internal/process/task_queues:96:5)
backend-1 | at async ConnectionManager._connect (/app/node_modules/sequelize/lib/dialects/abstract/connection-manager.js:222:24)
backend-1 | at async /app/node_modules/sequelize/lib/dialects/abstract/connection-manager.js:174:32
backend-1 | at async ConnectionManager.getConnection (/app/node_modules/sequelize/lib/dialects/abstract/connection-manager.js:197:7)
backend-1 | at async /app/node_modules/sequelize/lib/sequelize.js:305:26
backend-1 | at async Sequelize.authenticate (/app/node_modules/sequelize/lib/sequelize.js:457:5)
backend-1 | at async start (/app/index.js:24:9) {
backend-1 | parent: Error: connect ECONNREFUSED 172.18.0.2:3306
backend-1 | at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1133:16) {
backend-1 | errno: -111,
backend-1 | code: 'ECONNREFUSED',
backend-1 | syscall: 'connect',
backend-1 | address: '172.18.0.2',
backend-1 | port: 3306,
backend-1 | fatal: true
backend-1 | },
backend-1 | original: Error: connect ECONNREFUSED 172.18.0.2:3306
backend-1 | at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1133:16) {
backend-1 | errno: -111,
backend-1 | code: 'ECONNREFUSED',
backend-1 | syscall: 'connect',
backend-1 | address: '172.18.0.2',
backend-1 | port: 3306,
backend-1 | fatal: true
backend-1 | }
backend-1 | }
backend-1 | [nodemon] clean exit - waiting for changes before restart
mysql-1 | 2026-02-24T18:51:47.163168Z 0 [System] [MY-015018] [Server] MySQL Server Initialization - end.
mysql-1 | 2026-02-24 18:51:47+00:00 [Note] [Entrypoint]: Database files initialized
mysql-1 | 2026-02-24 18:51:47+00:00 [Note] [Entrypoint]: Starting temporary server
frontend-1 | ℹ 「wds」: Project is running at http://172.18.0.3/
frontend-1 | ℹ 「wds」: webpack output is served from
frontend-1 | ℹ 「wds」: Content not from webpack is served from /app/public
frontend-1 | ℹ 「wds」: 404s will fallback to /
frontend-1 | Starting the development server...
frontend-1 |
mysql-1 | 2026-02-24T18:51:47.325968Z 0 [System] [MY-015015] [Server] MySQL Server - start.
mysql-1 | 2026-02-24T18:51:48.095983Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.4.8) starting as process 121
mysql-1 | 2026-02-24T18:51:48.156048Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
frontend-1 | Browserslist: caniuse-lite is outdated. Please run:
frontend-1 | npx browserslist@latest --update-db
frontend-1 |
frontend-1 | Why you should do it regularly:
frontend-1 | https://github.com/browserslist/browserslist#browsers-data-updating
mysql-1 | 2026-02-24T18:51:49.408461Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
mysql-1 | 2026-02-24T18:51:50.724773Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
mysql-1 | 2026-02-24T18:51:50.724976Z 0 [System] [MY-013602] [Server] Channel mysql_main configured to support TLS. Encrypted connections are now supported for this channel.
mysql-1 | 2026-02-24T18:51:50.743250Z 0 [Warning] [MY-011810] [Server] Insecure configuration for --pid-file: Location '/var/run/mysqld' in the path is accessible to all OS users. Consider choosing a different directory.
mysql-1 | 2026-02-24T18:51:50.847385Z 0 [System] [MY-011323] [Server] X Plugin ready for connections. Socket: /var/run/mysqld/mysqlx.sock
mysql-1 | 2026-02-24T18:51:50.848729Z 0 [System] [MY-010931] [Server] /usr/sbin/mysqld: ready for connections. Version: '8.4.8' socket: '/var/run/mysqld/mysqld.sock' port: 0 MySQL Community Server - GPL.
mysql-1 | 2026-02-24 18:51:50+00:00 [Note] [Entrypoint]: Temporary server started.
mysql-1 | '/var/lib/mysql/mysql.sock' -> '/var/run/mysqld/mysqld.sock'
mysql-1 | Warning: Unable to load '/usr/share/zoneinfo/iso3166.tab' as time zone. Skipping it.
mysql-1 | Warning: Unable to load '/usr/share/zoneinfo/leap-seconds.list' as time zone. Skipping it.
mysql-1 | Warning: Unable to load '/usr/share/zoneinfo/leapseconds' as time zone. Skipping it.
mysql-1 | Warning: Unable to load '/usr/share/zoneinfo/tzdata.zi' as time zone. Skipping it.
mysql-1 | Warning: Unable to load '/usr/share/zoneinfo/zone.tab' as time zone. Skipping it.
mysql-1 | Warning: Unable to load '/usr/share/zoneinfo/zone1970.tab' as time zone. Skipping it.
mysql-1 | 2026-02-24 18:52:04+00:00 [Note] [Entrypoint]: Creating database author
mysql-1 |
mysql-1 | 2026-02-24 18:52:04+00:00 [Note] [Entrypoint]: Stopping temporary server
mysql-1 | 2026-02-24T18:52:04.335232Z 11 [System] [MY-013172] [Server] Received SHUTDOWN from user root. Shutting down mysqld (Version: 8.4.8).
mysql-1 | 2026-02-24T18:52:05.722258Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.4.8) MySQL Community Server - GPL.
mysql-1 | 2026-02-24T18:52:05.722364Z 0 [System] [MY-015016] [Server] MySQL Server - end.
mysql-1 | 2026-02-24 18:52:06+00:00 [Note] [Entrypoint]: Temporary server stopped
mysql-1 |
mysql-1 | 2026-02-24 18:52:06+00:00 [Note] [Entrypoint]: MySQL init process done. Ready for start up.
mysql-1 |
mysql-1 | 2026-02-24T18:52:06.407352Z 0 [System] [MY-015015] [Server] MySQL Server - start.
mysql-1 | 2026-02-24T18:52:06.969678Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.4.8) starting as process 1
mysql-1 | 2026-02-24T18:52:06.995074Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
mysql-1 | 2026-02-24T18:52:08.043036Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
mysql-1 | 2026-02-24T18:52:08.805972Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
mysql-1 | 2026-02-24T18:52:08.806130Z 0 [System] [MY-013602] [Server] Channel mysql_main configured to support TLS. Encrypted connections are now supported for this channel.
mysql-1 | 2026-02-24T18:52:08.815508Z 0 [Warning] [MY-011810] [Server] Insecure configuration for --pid-file: Location '/var/run/mysqld' in the path is accessible to all OS users. Consider choosing a different directory.
mysql-1 | 2026-02-24T18:52:08.906083Z 0 [System] [MY-011323] [Server] X Plugin ready for connections. Bind-address: '::' port: 33060, socket: /var/run/mysqld/mysqlx.sock
mysql-1 | 2026-02-24T18:52:08.908801Z 0 [System] [MY-010931] [Server] /usr/sbin/mysqld: ready for connections. Version: '8.4.8' socket: '/var/run/mysqld/mysqld.sock' port: 3306 MySQL Community Server - GPL.
frontend-1 | Compiled with warnings.
frontend-1 |
frontend-1 | src/App.js
frontend-1 | Line 1:16: 'FC' is defined but never used no-unused-vars
frontend-1 | Line 15:8: React Hook useEffect has a missing dependency: 'store'. Either include it or remove the dependency array react-hooks/exhaustive-deps
frontend-1 |
frontend-1 | src/components/LoginForm.js
frontend-1 | Line 1:16: 'FC' is defined but never used no-unused-vars
frontend-1 |
frontend-1 | src/http/index.js
frontend-1 | Line 20:31: Expected '===' and instead saw '==' eqeqeq
frontend-1 |
frontend-1 | src/store/store.js
frontend-1 | Line 53:19: 'response' is assigned a value but never used no-unused-vars
frontend-1 |
frontend-1 | Search for the keywords to learn more about each warning.
frontend-1 | To ignore, add // eslint-disable-next-line to the line before.
frontend-1 |
``` |
|
Добавлено через 2 часа 15 минут
Frontend
| PHP |
1
2
3
4
5
6
7
8
9
10
11
12
13
| FROM node:16.0.0-alpine
WORKDIR /app
EXPOSE 3000
COPY package*.json ./
RUN npm install
COPY . ./
CMD ["npm","run","start"] |
|
Backend-1
| Code |
1
2
3
4
5
6
7
8
9
10
11
12
13
| FROM node:16.0.0-alpine
WORKDIR /app
EXPOSE 3000
COPY package*.json ./
RUN npm install
COPY . ./
CMD ["npm","run","start"] |
|