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
1 change: 1 addition & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"workspaceFolder": "/workspace",
"shutdownAction": "stopCompose",
"postCreateCommand": "/docker-init.sh",
"postStartCommand": "/docker-start.sh",
"containerEnv": {
"EDITOR_VSCODE": "true"
},
Expand Down
2 changes: 2 additions & 0 deletions docker/app.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ RUN rm -rf /tmp/library-scripts

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

# Fix user UID / GID to match host
RUN groupmod --gid $USER_GID $USERNAME \
Expand Down
7 changes: 3 additions & 4 deletions docker/scripts/app-init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -94,14 +94,13 @@ echo "Running initial checks..."

/usr/local/bin/python $WORKSPACEDIR/ietf/manage.py migrate --fake-initial --settings=settings_local

echo "-----------------------------------------------------------------"
echo "Done!"
echo "-----------------------------------------------------------------"

if [ -z "$EDITOR_VSCODE" ]; then
CODE=0
python -m smtpd -n -c DebuggingServer localhost:2025 &
if [ -z "$*" ]; then
echo "-----------------------------------------------------------------"
echo "Ready!"
echo "-----------------------------------------------------------------"
echo
echo "You can execute arbitrary commands now, e.g.,"
echo
Expand Down
17 changes: 17 additions & 0 deletions docker/scripts/app-start.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash

sudo service rsyslog start &>/dev/null

# Run nginx

echo "Starting nginx..."
pidof nginx >/dev/null && echo "nginx is already running [ OK ]" || sudo nginx

# Run memcached

echo "Starting memcached..."
pidof memcached >/dev/null && echo "memcached is already running [ OK ]" || /usr/bin/memcached -u dev -d

echo "-----------------------------------------------------------------"
echo "Ready!"
echo "-----------------------------------------------------------------"