Update Dockerfile

This commit is contained in:
B05BEE13.卢郴群 2020-11-18 12:20:52 +08:00
parent 5c2420ab1d
commit 53d1bc0ea1
2 changed files with 6 additions and 5 deletions

View File

@ -10,7 +10,11 @@ COPY production.js /app/production.js
COPY schema.sql /app/schema.sql
WORKDIR /app
RUN npm install && service mysql start && mysql -u root < /app/schema.sql
RUN sed -i 's/test/root/g' /app/src/config/adapter.js \
&& sed -i 's/123456//g' /app/src/config/adapter.js \
&& npm install \
&& service mysql start \
&& mysql -u root < /app/schema.sql
EXPOSE 3306
EXPOSE 2000

View File

@ -1,7 +1,4 @@
CREATE USER 'test'@'127.0.0.1' IDENTIFIED BY '123456'; -- 创建一个以用户名为test密码为123456的用户
GRANT ALL ON *.* TO 'test'@'%'; -- 给刚创建的test用户数据库所有的权限
CREATE DATABASE mybookmarks DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci; -- 创建mybookmarks数据库
CREATE DATABASE mybookmarks DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci; -- 创建mybookmarks数据库
USE mybookmarks;
-- 用户信息表