chore: start devcontainer services on re-open (#5776)

This commit is contained in:
Nicolas Giard 2023-06-06 18:07:06 -04:00 committed by GitHub
parent fd2303044c
commit 52e175b39b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 23 additions and 4 deletions

View file

@ -7,6 +7,7 @@
"workspaceFolder": "/workspace",
"shutdownAction": "stopCompose",
"postCreateCommand": "/docker-init.sh",
"postStartCommand": "/docker-start.sh",
"containerEnv": {
"EDITOR_VSCODE": "true"
},

View file

@ -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 \

View file

@ -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

View file

@ -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 "-----------------------------------------------------------------"