chore: start devcontainer services on re-open (#5776)
This commit is contained in:
parent
fd2303044c
commit
52e175b39b
|
@ -7,6 +7,7 @@
|
||||||
"workspaceFolder": "/workspace",
|
"workspaceFolder": "/workspace",
|
||||||
"shutdownAction": "stopCompose",
|
"shutdownAction": "stopCompose",
|
||||||
"postCreateCommand": "/docker-init.sh",
|
"postCreateCommand": "/docker-init.sh",
|
||||||
|
"postStartCommand": "/docker-start.sh",
|
||||||
"containerEnv": {
|
"containerEnv": {
|
||||||
"EDITOR_VSCODE": "true"
|
"EDITOR_VSCODE": "true"
|
||||||
},
|
},
|
||||||
|
|
|
@ -42,7 +42,9 @@ RUN rm -rf /tmp/library-scripts
|
||||||
|
|
||||||
# Copy the startup file
|
# Copy the startup file
|
||||||
COPY docker/scripts/app-init.sh /docker-init.sh
|
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-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
|
# Fix user UID / GID to match host
|
||||||
RUN groupmod --gid $USER_GID $USERNAME \
|
RUN groupmod --gid $USER_GID $USERNAME \
|
||||||
|
|
|
@ -94,14 +94,13 @@ echo "Running initial checks..."
|
||||||
|
|
||||||
/usr/local/bin/python $WORKSPACEDIR/ietf/manage.py migrate --fake-initial --settings=settings_local
|
/usr/local/bin/python $WORKSPACEDIR/ietf/manage.py migrate --fake-initial --settings=settings_local
|
||||||
|
|
||||||
echo "-----------------------------------------------------------------"
|
|
||||||
echo "Done!"
|
|
||||||
echo "-----------------------------------------------------------------"
|
|
||||||
|
|
||||||
if [ -z "$EDITOR_VSCODE" ]; then
|
if [ -z "$EDITOR_VSCODE" ]; then
|
||||||
CODE=0
|
CODE=0
|
||||||
python -m smtpd -n -c DebuggingServer localhost:2025 &
|
python -m smtpd -n -c DebuggingServer localhost:2025 &
|
||||||
if [ -z "$*" ]; then
|
if [ -z "$*" ]; then
|
||||||
|
echo "-----------------------------------------------------------------"
|
||||||
|
echo "Ready!"
|
||||||
|
echo "-----------------------------------------------------------------"
|
||||||
echo
|
echo
|
||||||
echo "You can execute arbitrary commands now, e.g.,"
|
echo "You can execute arbitrary commands now, e.g.,"
|
||||||
echo
|
echo
|
||||||
|
|
17
docker/scripts/app-start.sh
Normal file
17
docker/scripts/app-start.sh
Normal 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 "-----------------------------------------------------------------"
|
Loading…
Reference in a new issue