-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Dockerfile and .devcontainer to run website locally (#2814)
* Add Dockerfile to run website locally and to run as devcontainer
- Loading branch information
1 parent
23b23c0
commit 7fb0069
Showing
5 changed files
with
72 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
{ | ||
"name": "MkDocs-VSCode", | ||
"build": { | ||
"context": "..", | ||
"dockerfile": "../Dockerfile" | ||
}, | ||
"customizations": { | ||
"vscode": { | ||
// Set *default* container specific settings.json values on container create. | ||
"settings": { | ||
"terminal.integrated.shell.linux": "/bin/bash", | ||
"debug.javascript.usePreview": false | ||
}, | ||
// Add the IDs of extensions you want installed when the container is created. | ||
"extensions": [ | ||
"yzhang.markdown-all-in-one", | ||
"redhat.vscode-yaml", | ||
"shardulm94.trailing-spaces", | ||
"oderwat.indent-rainbow", | ||
"msjsdiag.debugger-for-chrome", | ||
"ms-python.python", | ||
"ms-python.debugpy", | ||
"davidanson.vscode-markdownlint", | ||
"timonwong.shellcheck", | ||
"ms-python.vscode-pylance" | ||
] | ||
} | ||
}, | ||
// Use 'forwardPorts' to make a list of ports inside the container available locally. | ||
"forwardPorts": [ | ||
8000 | ||
] | ||
// Uncomment to connect as a non-root user. See https://aka.ms/vscode-remote/containers/non-root. | ||
//"remoteUser": "vscode" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
node_modules | ||
dist | ||
build | ||
.git | ||
Dockerfile | ||
.dockerignore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# Use the latest Python image | ||
FROM python:3-slim | ||
|
||
# Install dependencies | ||
RUN apt-get update && \ | ||
apt-get install -y git jq curl && \ | ||
apt-get clean && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
# Install Python dependencies | ||
COPY src/scripts/requirements.txt . | ||
RUN python -m pip install --no-cache-dir -r requirements.txt | ||
|
||
# Clone the OWASP MASVS as required by the website build | ||
RUN git clone --depth 1 https://github.com/OWASP/owasp-masvs.git /workspaces/owasp-masvs | ||
|
||
# Set the working directory this way to be compatible with devcontainers and also run independently | ||
WORKDIR /workspaces/owasp-mastg | ||
|
||
# Expose port 8000 | ||
EXPOSE 8000 | ||
|
||
# Start the container with a shell | ||
CMD ["bash"] | ||
|
||
# If running manually: docker run -it --rm -p 8000:8000 -v $(pwd):/workspaces/owasp-mastg mastg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
#!/bin/bash | ||
|
||
if [ -d "../owasp-masvs/" ] ; then | ||
MASVS_DIR=../owasp-masvs | ||
elif [ -d "./owasp-masvs/" ] ; then | ||
|