Refactor HTML and configuration files for improved structure and consistency
- Updated videos.html to enhance readability and maintainability. - Refactored webpack.config.js for better organization and clarity. - Cleaned up TypeScript configuration files (tsconfig.app.json, tsconfig.json, tsconfig.spec.json) for consistency in formatting. - Adjusted docker-compose.yaml for improved formatting and readability.
This commit is contained in:
@@ -1,20 +1,19 @@
|
||||
FROM mcr.microsoft.com/devcontainers/dotnet:1-8.0-bookworm
|
||||
|
||||
# Install SQL Tools: SQLPackage and sqlcmd
|
||||
COPY mssql/installSQLtools.sh installSQLtools.sh
|
||||
RUN bash ./installSQLtools.sh \
|
||||
&& apt-get clean -y && rm -rf /var/lib/apt/lists/* /tmp/library-scripts
|
||||
|
||||
# RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - && \
|
||||
# echo "deb http://dl.google.com/linux/chrome/deb/ stable main" > /etc/apt/sources.list.d/google.list && \
|
||||
# apt-get update && apt-get install -y google-chrome-stable xvfb
|
||||
# [Optional] Uncomment this section to install additional OS packages.
|
||||
# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
|
||||
# && apt-get -y install --no-install-recommends <your-package-list-here>
|
||||
|
||||
ENV ASPNETCORE_HTTP_PORTS=5000
|
||||
|
||||
EXPOSE 4200
|
||||
# [Optional] Uncomment this line to install global node packages.
|
||||
RUN su vscode -c "source /usr/local/share/nvm/nvm.sh && nvm install --lts && nvm use --lts && npm install -g typescript" 2>&1
|
||||
# RUN su vscode -c "source /usr/local/share/nvm/nvm.sh && npm install -g <your-package-here>" 2>&1
|
||||
FROM mcr.microsoft.com/devcontainers/dotnet:1-8.0-bookworm
|
||||
|
||||
# Install SQL Tools: SQLPackage and sqlcmd
|
||||
COPY mssql/installSQLtools.sh installSQLtools.sh
|
||||
RUN bash ./installSQLtools.sh && apt-get clean -y && rm -rf /var/lib/apt/lists/* /tmp/library-scripts
|
||||
|
||||
# RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - && \
|
||||
# echo "deb http://dl.google.com/linux/chrome/deb/ stable main" > /etc/apt/sources.list.d/google.list && \
|
||||
# apt-get update && apt-get install -y google-chrome-stable xvfb
|
||||
# [Optional] Uncomment this section to install additional OS packages.
|
||||
# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
|
||||
# && apt-get -y install --no-install-recommends <your-package-list-here>
|
||||
|
||||
ENV ASPNETCORE_HTTP_PORTS=5000
|
||||
|
||||
EXPOSE 4200
|
||||
# [Optional] Uncomment this line to install global node packages.
|
||||
RUN su vscode -c "source /usr/local/share/nvm/nvm.sh && nvm install --lts && nvm use --lts && npm install -g typescript" 2>&1
|
||||
# RUN su vscode -c "source /usr/local/share/nvm/nvm.sh && npm install -g <your-package-here>" 2>&1
|
||||
|
||||
@@ -1,59 +1,59 @@
|
||||
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
|
||||
// README at: https://github.com/devcontainers/templates/tree/main/src/dotnet-mssql
|
||||
{
|
||||
"name": ".NET (C#), Node.js (TypeScript) & MS SQL",
|
||||
"dockerComposeFile": "docker-compose.yml",
|
||||
"service": "app",
|
||||
"workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}",
|
||||
// Features to add to the dev container. More info: https://containers.dev/features.
|
||||
// "features": {},
|
||||
// Configure tool-specific properties.
|
||||
"customizations": {
|
||||
// Configure properties specific to VS Code.
|
||||
"vscode": {
|
||||
// Set *default* container specific settings.json values on container create.
|
||||
"settings": {
|
||||
"mssql.connections": [
|
||||
{
|
||||
"server": "localhost,1433",
|
||||
"database": "",
|
||||
"authenticationType": "SqlLogin",
|
||||
"user": "sa",
|
||||
"password": "P@ssw0rd",
|
||||
"emptyPasswordInput": false,
|
||||
"savePassword": false,
|
||||
"profileName": "mssql-container"
|
||||
}
|
||||
]
|
||||
},
|
||||
// Add the IDs of extensions you want installed when the container is created.
|
||||
"extensions": [
|
||||
"ms-dotnettools.csharp",
|
||||
"ms-mssql.mssql"
|
||||
]
|
||||
}
|
||||
},
|
||||
// Use 'forwardPorts' to make a list of ports inside the container available locally.
|
||||
"forwardPorts": [
|
||||
4200,
|
||||
5000,
|
||||
5001,
|
||||
1433
|
||||
],
|
||||
"portsAttributes": {
|
||||
"5001": {
|
||||
"protocol": "https"
|
||||
},
|
||||
"1433": {
|
||||
"protocol": "tcp"
|
||||
}
|
||||
},
|
||||
// postCreateCommand.sh parameters: $1=SA password, $2=dacpac path, $3=sql script(s) path
|
||||
"containerEnv": {
|
||||
"SA_PASSWORD": "P@ssw0rd",
|
||||
"ACCEPT_EULA": "Y"
|
||||
},
|
||||
"postCreateCommand": "bash .devcontainer/mssql/postCreateCommand.sh 'P@ssw0rd' './bin/Debug/' './.devcontainer/mssql/'"
|
||||
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
|
||||
// "remoteUser": "root"
|
||||
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
|
||||
// README at: https://github.com/devcontainers/templates/tree/main/src/dotnet-mssql
|
||||
{
|
||||
"name": ".NET (C#), Node.js (TypeScript) & MS SQL",
|
||||
"dockerComposeFile": "docker-compose.yml",
|
||||
"service": "app",
|
||||
"workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}",
|
||||
// Features to add to the dev container. More info: https://containers.dev/features.
|
||||
// "features": {},
|
||||
// Configure tool-specific properties.
|
||||
"customizations": {
|
||||
// Configure properties specific to VS Code.
|
||||
"vscode": {
|
||||
// Set *default* container specific settings.json values on container create.
|
||||
"settings": {
|
||||
"mssql.connections": [
|
||||
{
|
||||
"server": "localhost,1433",
|
||||
"database": "",
|
||||
"authenticationType": "SqlLogin",
|
||||
"user": "sa",
|
||||
"password": "P@ssw0rd",
|
||||
"emptyPasswordInput": false,
|
||||
"savePassword": false,
|
||||
"profileName": "mssql-container"
|
||||
}
|
||||
]
|
||||
},
|
||||
// Add the IDs of extensions you want installed when the container is created.
|
||||
"extensions": [
|
||||
"ms-dotnettools.csharp",
|
||||
"ms-mssql.mssql"
|
||||
]
|
||||
}
|
||||
},
|
||||
// Use 'forwardPorts' to make a list of ports inside the container available locally.
|
||||
"forwardPorts": [
|
||||
4200,
|
||||
5000,
|
||||
5001,
|
||||
1433
|
||||
],
|
||||
"portsAttributes": {
|
||||
"5001": {
|
||||
"protocol": "https"
|
||||
},
|
||||
"1433": {
|
||||
"protocol": "tcp"
|
||||
}
|
||||
},
|
||||
// postCreateCommand.sh parameters: $1=SA password, $2=dacpac path, $3=sql script(s) path
|
||||
"containerEnv": {
|
||||
"SA_PASSWORD": "P@ssw0rd",
|
||||
"ACCEPT_EULA": "Y"
|
||||
},
|
||||
"postCreateCommand": "bash .devcontainer/mssql/postCreateCommand.sh 'P@ssw0rd' './bin/Debug/' './.devcontainer/mssql/'"
|
||||
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
|
||||
// "remoteUser": "root"
|
||||
}
|
||||
@@ -1,34 +1,34 @@
|
||||
version: '3'
|
||||
|
||||
services:
|
||||
app:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
|
||||
volumes:
|
||||
- ../..:/workspaces:cached
|
||||
|
||||
# Overrides default command so things don't shut down after the process ends.
|
||||
command: sleep infinity
|
||||
ports:
|
||||
- "4200:4200"
|
||||
# Runs app on the same network as the database container, allows "forwardPorts" in devcontainer.json function.
|
||||
network_mode: host
|
||||
|
||||
# Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
|
||||
# user: root
|
||||
|
||||
# Use "forwardPorts" in **devcontainer.json** to forward an app port locally.
|
||||
# (Adding the "ports" property to this file will not forward from a Codespace.)
|
||||
|
||||
db:
|
||||
image: mcr.microsoft.com/mssql/server:2019-latest
|
||||
restart: unless-stopped
|
||||
network_mode: host
|
||||
environment:
|
||||
SA_PASSWORD: P@ssw0rd
|
||||
ACCEPT_EULA: Y
|
||||
|
||||
# Add "forwardPorts": ["db:1433"] to **devcontainer.json** to forward MSSQL locally.
|
||||
# (Adding the "ports" property to this file will not forward from a Codespace.)
|
||||
version: '3'
|
||||
|
||||
services:
|
||||
app:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
|
||||
volumes:
|
||||
- ../..:/workspaces:cached
|
||||
|
||||
# Overrides default command so things don't shut down after the process ends.
|
||||
command: sleep infinity
|
||||
ports:
|
||||
- "4200:4200"
|
||||
# Runs app on the same network as the database container, allows "forwardPorts" in devcontainer.json function.
|
||||
network_mode: host
|
||||
|
||||
# Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
|
||||
# user: root
|
||||
|
||||
# Use "forwardPorts" in **devcontainer.json** to forward an app port locally.
|
||||
# (Adding the "ports" property to this file will not forward from a Codespace.)
|
||||
|
||||
db:
|
||||
image: mcr.microsoft.com/mssql/server:2019-latest
|
||||
restart: unless-stopped
|
||||
network_mode: host
|
||||
environment:
|
||||
SA_PASSWORD: P@ssw0rd
|
||||
ACCEPT_EULA: Y
|
||||
|
||||
# Add "forwardPorts": ["db:1433"] to **devcontainer.json** to forward MSSQL locally.
|
||||
# (Adding the "ports" property to this file will not forward from a Codespace.)
|
||||
|
||||
64
.devcontainer/mssql/postCreateCommand-backup.sh
Normal file
64
.devcontainer/mssql/postCreateCommand-backup.sh
Normal file
@@ -0,0 +1,64 @@
|
||||
#!/bin/bash
|
||||
dacpac="false"
|
||||
sqlfiles="false"
|
||||
SApassword=$1
|
||||
dacpath=$2
|
||||
sqlpath=$3
|
||||
|
||||
echo "SELECT * FROM SYS.DATABASES" | dd of=testsqlconnection.sql
|
||||
for i in {1..60};
|
||||
do
|
||||
/opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P $SApassword -d master -i testsqlconnection.sql > /dev/null
|
||||
if [ $? -eq 0 ]
|
||||
then
|
||||
echo "SQL server ready"
|
||||
break
|
||||
else
|
||||
echo "Not ready yet..."
|
||||
sleep 1
|
||||
fi
|
||||
done
|
||||
rm testsqlconnection.sql
|
||||
|
||||
for f in $dacpath/*
|
||||
do
|
||||
if [ $f == $dacpath/*".dacpac" ]
|
||||
then
|
||||
dacpac="true"
|
||||
echo "Found dacpac $f"
|
||||
fi
|
||||
done
|
||||
|
||||
for f in $sqlpath/*
|
||||
do
|
||||
if [ $f == $sqlpath/*".sql" ]
|
||||
then
|
||||
sqlfiles="true"
|
||||
echo "Found SQL file $f"
|
||||
fi
|
||||
done
|
||||
|
||||
if [ $sqlfiles == "true" ]
|
||||
then
|
||||
for f in $sqlpath/*
|
||||
do
|
||||
if [ $f == $sqlpath/*".sql" ]
|
||||
then
|
||||
echo "Executing $f"
|
||||
/opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P $SApassword -d master -i $f
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
if [ $dacpac == "true" ]
|
||||
then
|
||||
for f in $dacpath/*
|
||||
do
|
||||
if [ $f == $dacpath/*".dacpac" ]
|
||||
then
|
||||
dbname=$(basename $f ".dacpac")
|
||||
echo "Deploying dacpac $f"
|
||||
/opt/sqlpackage/sqlpackage /Action:Publish /SourceFile:$f /TargetServerName:localhost /TargetDatabaseName:$dbname /TargetUser:sa /TargetPassword:$SApassword
|
||||
fi
|
||||
done
|
||||
fi
|
||||
@@ -5,60 +5,9 @@ SApassword=$1
|
||||
dacpath=$2
|
||||
sqlpath=$3
|
||||
|
||||
echo "SELECT * FROM SYS.DATABASES" | dd of=testsqlconnection.sql
|
||||
for i in {1..60};
|
||||
do
|
||||
/opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P $SApassword -d master -i testsqlconnection.sql > /dev/null
|
||||
if [ $? -eq 0 ]
|
||||
then
|
||||
echo "SQL server ready"
|
||||
break
|
||||
else
|
||||
echo "Not ready yet..."
|
||||
sleep 1
|
||||
fi
|
||||
done
|
||||
rm testsqlconnection.sql
|
||||
|
||||
for f in $dacpath/*
|
||||
do
|
||||
if [ $f == $dacpath/*".dacpac" ]
|
||||
then
|
||||
dacpac="true"
|
||||
echo "Found dacpac $f"
|
||||
fi
|
||||
done
|
||||
|
||||
for f in $sqlpath/*
|
||||
do
|
||||
if [ $f == $sqlpath/*".sql" ]
|
||||
then
|
||||
sqlfiles="true"
|
||||
echo "Found SQL file $f"
|
||||
fi
|
||||
done
|
||||
|
||||
if [ $sqlfiles == "true" ]
|
||||
then
|
||||
for f in $sqlpath/*
|
||||
do
|
||||
if [ $f == $sqlpath/*".sql" ]
|
||||
then
|
||||
echo "Executing $f"
|
||||
/opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P $SApassword -d master -i $f
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
if [ $dacpac == "true" ]
|
||||
then
|
||||
for f in $dacpath/*
|
||||
do
|
||||
if [ $f == $dacpath/*".dacpac" ]
|
||||
then
|
||||
dbname=$(basename $f ".dacpac")
|
||||
echo "Deploying dacpac $f"
|
||||
/opt/sqlpackage/sqlpackage /Action:Publish /SourceFile:$f /TargetServerName:localhost /TargetDatabaseName:$dbname /TargetUser:sa /TargetPassword:$SApassword
|
||||
fi
|
||||
done
|
||||
fi
|
||||
cd Api
|
||||
dotnet restore ./Api.csproj
|
||||
dotnet build ./Api.csproj
|
||||
dotnet tool install --global dotnet-ef --version 8.*
|
||||
export PATH="$PATH:/root/.dotnet/tools"
|
||||
dotnet-ef database update --project ./Api.csproj --startup-project ./Api.csproj
|
||||
@@ -1,2 +0,0 @@
|
||||
CREATE DATABASE ApplicationDB;
|
||||
GO
|
||||
Reference in New Issue
Block a user