This is an automated email from the ASF dual-hosted git repository.
msciabarra pushed a commit to branch main
in repository
https://gitbox.apache.org/repos/asf/openserverless-devcontainer.git
The following commit(s) were added to refs/heads/main by this push:
new 1ba5d69 building
1ba5d69 is described below
commit 1ba5d69f98e913c62993c5dd6e33d4187020bf93
Author: Michele Sciabarra <[email protected]>
AuthorDate: Sun Nov 23 14:38:47 2025 +0000
building
---
Dockerfile | 26 ++++++++++++++++----------
Taskfile.yml | 2 +-
start.sh | 43 +++++++++++++++++++++----------------------
supervisord.ini | 22 ++++++++++++++++++++++
4 files changed, 60 insertions(+), 33 deletions(-)
diff --git a/Dockerfile b/Dockerfile
index 7f468fc..306c01d 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -35,18 +35,24 @@ COPY --from=pgloader-builder
/build/pgloader/build/bin/pgloader /usr/bin/pgloade
RUN \
curl -LsSf https://astral.sh/uv/install.sh | sh
RUN \
- npm install -g concurrently opencode-ai
-RUN \
- curl -sL
https://raw.githubusercontent.com/apache/openserverless-cli/refs/heads/main/install.sh
| bash \
- && mv ~/.local/bin/ops /usr/local/bin/ops
+ npm install -g npm
-# remove node
RUN userdel node ; rm -Rvf /home/node
-ENV HOME=/home
+ENV OPS_HOME=/home
ENV OPS_BRANCH=main
-ADD start.sh /start.sh
+ENV PATH=/home/.local/bin:/usr/local/bin:/usr/bin:/bin
+RUN printf "OPS_HOME=$OPS_HOME\nOPS_BRANCH=$OPS_BRANCH\nPATH=$PATH\n"
>/etc/environment
+RUN \
+ export HOME=/home ;\
+ curl -sL
https://raw.githubusercontent.com/apache/openserverless-cli/refs/heads/main/install.sh
| bash ;\
+ ops -t ;\
+ git clone https://github.com/apache/openserverless-devcontainer
$HOME/.ops/openserverless-devcontainer ;\
+ ln -sf $HOME/.ops/openserverless-devcontainer/olaris-tk
$HOME/.ops/olaris-tk
+
+ADD supervisord.ini /etc/supervisord.ini
+ADD start.sh /usr/local/bin/start.sh
+RUN mkdir /home/workspace
+WORKDIR /home/workspace
ENTRYPOINT ["tini", "--"]
-CMD ["/start.sh"]
-RUN mkdir /workspace
-WORKDIR /workspace
+CMD ["/usr/local/bin/start.sh"]
diff --git a/Taskfile.yml b/Taskfile.yml
index 7ee804a..c5b1a9d 100644
--- a/Taskfile.yml
+++ b/Taskfile.yml
@@ -15,7 +15,7 @@ tasks:
image-tag:
- git tag -d "$(git tag)" || true
- git tag "0.1.0-incubating.$(date +%y%m%d%H%M)"
- - task: show
+ - echo {{.NAME}}:$(git tag --sort=-creatordate | head -n 1)
build:
- docker build -t "{{.NAME}}:{{.TAG}}" . --load
diff --git a/start.sh b/start.sh
index 0b5ed0b..e777496 100755
--- a/start.sh
+++ b/start.sh
@@ -4,29 +4,28 @@
mkdir -p /run/sshd
ssh-keygen -A
-export PORT1=${SSH_PORT:-2222}
-export PORT2=${OPENCODE_PORT:-2223}
+# update ops
+export OPS_HOME=/home
+ops -update
-# setup user
-export HOME=/home
-if test -n "$USERID"
-then
- useradd -u "$USERID" -d /home -o -U user -s /bin/bash
- ops -update
- git clone https://github.com/apache/openserverless-devcontainer
$HOME/.ops/openserverless-devcontainer
- ln -sf $HOME/.ops/openserverless-devcontainer/olaris-tk
$HOME/.ops/olaris-tk
+# setup user workspace
+export HOME=/home/workspace
+if test -z "$USERID"
+then USERID=1000
+fi
+/usr/sbin/useradd -u "$USERID" -d $HOME -o -U -s /bin/bash workspace
- if test -n "$SSHKEY"
- then
- mkdir -p $HOME/.ssh
- echo "$SSHKEY" >>$HOME/.ssh/authorized_keys
- chmod 600 ~/.ssh/authorized_keys
- fi
- chown -Rvf "$USERID" /home
+# add ssh key
+if test -n "$SSHKEY"
+then
+ mkdir -p $HOME/.ssh
+ echo "$SSHKEY" >>$HOME/.ssh/authorized_keys
+ chmod 600 ~/.ssh/authorized_keys
fi
-cd /workspace
-echo Starting ssh in port $PORT1 and opencode in $PORT2 for user $USERID
-concurrently \
- "sudo /usr/sbin/sshd -p $PORT1 -D" \
- "opencode serve -p $PORT2 --hostname 0.0.0.0"
+
+# fix permissions
+chown -Rf "$USERID" /home
+
+# start supervisor
+supervisord -c /etc/supervisord.ini
diff --git a/supervisord.ini b/supervisord.ini
new file mode 100644
index 0000000..e7c530d
--- /dev/null
+++ b/supervisord.ini
@@ -0,0 +1,22 @@
+[supervisord]
+nodaemon=true
+logfile=/dev/stdout
+logfile_maxbytes=0
+pidfile=/tmp/supervisord.pid
+user=root
+
+[program:sshd]
+command=/usr/sbin/sshd -p 2222 -D
+directory=/
+user=root
+autostart=true
+autorestart=true
+startretries=10
+stdout_logfile=/dev/stdout
+stdout_logfile_maxbytes=0
+stderr_logfile=/dev/stderr
+stderr_logfile_maxbytes=0
+stopsignal=TERM
+stopasgroup=true
+killasgroup=true
+