PromucFlow_constructor/Dockerfile
Shrikant Sharat Kandula d0c2d40c7b
chore: Logs and potential fix for CI startup flakiness (#34461)
The `tlog` command isn't predictably getting the executable permission,
so we're explicitly setting that up in `Dockerfile` here.

As well as in the setup script for Cypress, if we get a 502 even after
90 seconds, we print the logs of the `appsmith` container, so we're not
guessing the causes. This should provide us more information next time
we see such flakiness.

**/test sanity**



<!-- This is an auto-generated comment: Cypress test results  -->
> [!TIP]
> 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
> Workflow run:
<https://github.com/appsmithorg/appsmith/actions/runs/9658565348>
> Commit: 96c777dd9a1bd8c28477bf1dcd1d4748ced0022e
> <a
href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=9658565348&attempt=1"
target="_blank">Cypress dashboard</a>.
> Tags: `@tag.Sanity`

<!-- end of auto-generated comment: Cypress test results  -->



<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

- **Chores**
- Updated Dockerfile to ensure custom command-scripts in `/opt/bin/`
have executable permissions.
- Enhanced `setup-test-ci.sh` script to output `appsmith` logs when the
server connection fails.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2024-06-25 14:03:56 +05:30

56 lines
1.8 KiB
Docker

ARG BASE
FROM ${BASE}
ENV IN_DOCKER=1
# 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 '{}' ';'
# Ensure all custom command-scripts have executable permission
chmod +x /opt/bin/*
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"]