add Dockerfile
This commit is contained in:
parent
ef42a5ada7
commit
5c2420ab1d
|
|
@ -0,0 +1,17 @@
|
||||||
|
FROM luchenqun/ubuntu-mysql-node
|
||||||
|
LABEL maintainer="luchenqun@qq.com"
|
||||||
|
|
||||||
|
RUN mkdir -p /app
|
||||||
|
COPY src /app/src
|
||||||
|
COPY view /app/view
|
||||||
|
COPY www /app/www
|
||||||
|
COPY package.json /app/package.json
|
||||||
|
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
|
||||||
|
|
||||||
|
EXPOSE 3306
|
||||||
|
EXPOSE 2000
|
||||||
|
CMD ["node production.js"]
|
||||||
|
|
@ -1,3 +1,9 @@
|
||||||
|
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数据库
|
||||||
|
USE mybookmarks;
|
||||||
|
|
||||||
-- 用户信息表
|
-- 用户信息表
|
||||||
drop table if exists users;
|
drop table if exists users;
|
||||||
CREATE TABLE `users` (
|
CREATE TABLE `users` (
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue