Logs messages from `entrypoint.sh` and the other `run-*.sh` scripts don't show timestamp today, and its getting hard to see the order of things in the logs, especially between different processes. This PR adds a command `tlog` to print logs with UTC timestamp prefixed. We're only using it in `entrypoint.sh` now, but follow-up PR(s) will add it to the other `run-*` scripts as well. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Chores** - Updated Dockerfile to include `/opt/bin` in the `PATH` and modified permissions settings for executable files. - **Refactor** - Enhanced logging in the entrypoint script by replacing `echo` statements with `tlog` for better clarity and debugging. - **New Features** - Introduced `tlog`, a new shell script for consistent and timestamped logging. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
51 lines
1.7 KiB
Docker
51 lines
1.7 KiB
Docker
ARG BASE
|
|
FROM ${BASE}
|
|
|
|
# Add backend server - Application Layer
|
|
ARG JAR_FILE=./app/server/dist/server-*.jar
|
|
ARG PLUGIN_JARS=./app/server/dist/plugins/*.jar
|
|
|
|
ARG APPSMITH_CLOUD_SERVICES_BASE_URL
|
|
ENV APPSMITH_CLOUD_SERVICES_BASE_URL=${APPSMITH_CLOUD_SERVICES_BASE_URL}
|
|
|
|
ARG APPSMITH_SEGMENT_CE_KEY
|
|
ENV APPSMITH_SEGMENT_CE_KEY=${APPSMITH_SEGMENT_CE_KEY}
|
|
|
|
COPY deploy/docker/fs /
|
|
|
|
RUN <<END
|
|
mkdir -p ./editor ./rts ./backend/plugins
|
|
|
|
# Ensure all *.sh scripts are executable.
|
|
find . -name node_modules -prune -or -type f -name '*.sh' -print -exec chmod +x '{}' ';'
|
|
END
|
|
|
|
#Add the jar to the container
|
|
COPY ${JAR_FILE} backend/server.jar
|
|
COPY ${PLUGIN_JARS} backend/plugins/
|
|
|
|
# Add client UI - Application Layer
|
|
COPY ./app/client/build editor/
|
|
|
|
# Add RTS - Application Layer
|
|
COPY ./app/client/packages/rts/dist rts/
|
|
|
|
ENV PATH /opt/bin:/opt/appsmith/utils/node_modules/.bin:/opt/java/bin:/opt/node/bin:$PATH
|
|
|
|
RUN cd ./utils && npm install --only=prod && npm install --only=prod -g . && cd - \
|
|
&& chmod +x /opt/bin/* *.sh /watchtower-hooks/*.sh \
|
|
# Disable setuid/setgid bits for the files inside container.
|
|
&& find / \( -path /proc -prune \) -o \( \( -perm -2000 -o -perm -4000 \) -print -exec chmod -s '{}' + \) || true \
|
|
&& mkdir -p /.mongodb/mongosh /appsmith-stacks \
|
|
&& chmod ugo+w /etc /appsmith-stacks \
|
|
&& chmod -R ugo+w /var/run /.mongodb /etc/ssl /usr/local/share
|
|
|
|
LABEL com.centurylinklabs.watchtower.lifecycle.pre-check=/watchtower-hooks/pre-check.sh
|
|
LABEL com.centurylinklabs.watchtower.lifecycle.pre-update=/watchtower-hooks/pre-update.sh
|
|
|
|
EXPOSE 80
|
|
EXPOSE 443
|
|
ENTRYPOINT [ "/opt/appsmith/entrypoint.sh" ]
|
|
HEALTHCHECK --interval=15s --timeout=15s --start-period=45s CMD "/opt/appsmith/healthcheck.sh"
|
|
CMD ["/usr/bin/supervisord", "-n"]
|