mirror of
https://github.com/docker-training/node-bulletin-board.git
synced 2025-12-13 06:16:43 +08:00
Add v4, with proxy, app and db
This commit is contained in:
10
bulletin-board-db/Dockerfile
Normal file
10
bulletin-board-db/Dockerfile
Normal file
@@ -0,0 +1,10 @@
|
||||
FROM microsoft/mssql-server-linux:2017-CU1
|
||||
|
||||
ENV ACCEPT_EULA=Y \
|
||||
MSSQL_SA_PASSWORD=DockerCon!!!
|
||||
|
||||
WORKDIR /init
|
||||
COPY init-db.* ./
|
||||
|
||||
RUN chmod +x ./init-db.sh
|
||||
RUN /opt/mssql/bin/sqlservr & ./init-db.sh
|
||||
3
bulletin-board-db/init-db.sh
Normal file
3
bulletin-board-db/init-db.sh
Normal file
@@ -0,0 +1,3 @@
|
||||
sleep 30s
|
||||
|
||||
/opt/mssql-tools/bin/sqlcmd -S localhost -U SA -P DockerCon!!! -i init-db.sql
|
||||
20
bulletin-board-db/init-db.sql
Normal file
20
bulletin-board-db/init-db.sql
Normal file
@@ -0,0 +1,20 @@
|
||||
CREATE DATABASE BulletinBoard;
|
||||
GO
|
||||
|
||||
USE BulletinBoard;
|
||||
|
||||
CREATE TABLE Events (
|
||||
Id INT IDENTITY(1,1) NOT NULL PRIMARY KEY,
|
||||
Title NVARCHAR(50),
|
||||
Detail NVARCHAR(200),
|
||||
[Date] DATETIMEOFFSET,
|
||||
CreatedAt DATETIMEOFFSET NOT NULL,
|
||||
UpdatedAt DATETIMEOFFSET NOT NULL
|
||||
);
|
||||
|
||||
INSERT INTO Events (Title, Detail, [Date], CreatedAt, UpdatedAt) VALUES
|
||||
(N'Docker for Beginners', N'Introduction to Docker using Node.js', '2017-11-21', GETDATE(), GETDATE()),
|
||||
(N'Advanced Orchestration', N'Deep dive into Docker Swarm', '2017-12-25', GETDATE(), GETDATE()),
|
||||
(N'Docker on Windows', N'From 101 to production', '2018-01-01', GETDATE(), GETDATE());
|
||||
|
||||
SELECT * FROM BulletinBoard.dbo.Events;
|
||||
Reference in New Issue
Block a user