Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"name": "IETF Datatracker",
"dockerComposeFile": ["../docker-compose.yml", "docker-compose.extend.yml"],
"service": "app",
"workspaceFolder": "/root/src",
"workspaceFolder": "/workspace",
"shutdownAction": "stopCompose",
"postCreateCommand": "/docker-init.sh",
"containerEnv": {
Expand Down Expand Up @@ -69,7 +69,10 @@
"spmeesseman.vscode-taskexplorer",
"mtxr.sqltools",
"mtxr.sqltools-driver-mysql",
"mrmlnc.vscode-duplicate"
"mrmlnc.vscode-duplicate",
"eamodio.gitlens",
"oderwat.indent-rainbow",
"johnsoncodehk.volar"
],

// Use 'forwardPorts' to make a list of ports inside the container available locally.
Expand Down
4 changes: 2 additions & 2 deletions .devcontainer/docker-compose.extend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ services:
EDITOR_VSCODE: 1
DJANGO_SETTINGS_MODULE: settings_local_sqlitetest
volumes:
- .:/root/src
- /root/src/node_modules
- .:/workspace
- /workspace/node_modules
# Runs app on the same network as the database container, allows "forwardPorts" in devcontainer.json function.
network_mode: service:db
4 changes: 3 additions & 1 deletion .npmrc
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
save-exact = true
save-prefix = ""
save-prefix = ""
fund = false
loglevel = "warn"
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"**/third_party/**",
"**/vendor/**",
"**/work/**",
"/root/src/bootstrap/nuget/MyGet.ps1"
"/workspace/bootstrap/nuget/MyGet.ps1"
],
"taskExplorer.enableAnt": false,
"taskExplorer.enableAppPublisher": false,
Expand Down
17 changes: 15 additions & 2 deletions docker/app.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ ENV DBUS_SESSION_BUS_ADDRESS=/dev/null
ENV npm_config_loglevel warn
# allow installing when the main user is root
ENV npm_config_unsafe_perm true
# disable NPM funding messages
ENV npm_config_fund false

# Set locale to en_US.UTF-8
RUN echo "LC_ALL=en_US.UTF-8" >> /etc/environment && \
Expand All @@ -99,7 +101,7 @@ RUN echo "LC_ALL=en_US.UTF-8" >> /etc/environment && \
ENV LC_ALL en_US.UTF-8

# Install bower
RUN npm install -g bower
RUN npm install -g bower grunt-cli

# Install idnits
ADD https://raw.githubusercontent.com/ietf-tools/idnits-mirror/main/idnits /usr/local/bin/
Expand All @@ -116,10 +118,21 @@ RUN sed -i '/imklog/s/^/#/' /etc/rsyslog.conf
# Colorize the bash shell
RUN sed -i 's/#force_color_prompt=/force_color_prompt=/' /root/.bashrc

ADD https://raw.githubusercontent.com/eficode/wait-for/v2.1.3/wait-for /usr/local/bin/
RUN chmod +rx /usr/local/bin/wait-for

# Copy the startup file
COPY docker/scripts/app-init.sh /docker-init.sh
RUN sed -i 's/\r$//' /docker-init.sh && \
chmod +x /docker-init.sh

WORKDIR /root/src
# Create workspace
RUN mkdir -p /workspace
WORKDIR /workspace

# Install NPM modules
COPY package.json package.json
RUN npm install --no-audit
RUN rm -f package.json package-lock.json

# ENTRYPOINT [ "/docker-init.sh" ]
4 changes: 2 additions & 2 deletions docker/docker-compose.extend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ services:
ports:
- '8000:8000'
volumes:
- .:/root/src
- /root/src/node_modules
- .:/workspace
- /workspace/node_modules
db:
ports:
- '3306'
2 changes: 1 addition & 1 deletion docker/run
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
cd ..
docker-compose -f docker-compose.yml -f docker/docker-compose.extend.yml up -d
docker-compose exec app /bin/sh /docker-init.sh
docker-compose down
docker-compose stop
cd docker
2 changes: 1 addition & 1 deletion docker/scripts/app-cypress.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

WORKSPACEDIR="/root/src"
WORKSPACEDIR="/workspace"

pushd .
cd $WORKSPACEDIR
Expand Down
12 changes: 6 additions & 6 deletions docker/scripts/app-init.sh
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
#!/bin/bash

WORKSPACEDIR="/root/src"
WORKSPACEDIR="/workspace"

service rsyslog start

# Generate static assets

npm install
npm install --prefer-offline --no-audit
echo "Building static assets... (this could take a minute or two)"
cd bootstrap
npm install -g grunt-cli
npm install
npm install -g grunt-cli --prefer-offline --no-audit
npm install --prefer-offline --no-audit
grunt dist
cp -r dist/. ../ietf/static/ietf/bootstrap/
cd ..
Expand Down Expand Up @@ -81,7 +81,7 @@ for sub in \
data/developers/www6/iesg/evaluation \
data/developers/media/photo \
; do
dir="/root/src/$sub"
dir="/workspace/$sub"
if [ ! -d "$dir" ]; then
echo "Creating dir $dir"
mkdir -p "$dir";
Expand All @@ -91,7 +91,7 @@ done
# Wait for DB container
if [ -n "$EDITOR_VSCODE" ]; then
echo "Waiting for DB container to come online ..."
wget -qO- https://raw.githubusercontent.com/eficode/wait-for/v2.1.3/wait-for | sh -s -- localhost:3306 -- echo "DB ready"
/usr/local/bin/wait-for localhost:3306 -- echo "DB ready"
fi

# Initial checks
Expand Down
2 changes: 1 addition & 1 deletion docker/scripts/app-win32-timezone-fix.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

WORKSPACEDIR="/root/src"
WORKSPACEDIR="/workspace"

ICSFILES=$(/usr/bin/find $WORKSPACEDIR/vzic/zoneinfo/ -name '*.ics' -print)
for ICSFILE in $ICSFILES
Expand Down