Skip to content

fix: updated docker file to use lock file if it's present, if it's no… #34833

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: release
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 25 additions & 19 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# Base stage
ARG BASE
FROM ${BASE}

ENV IN_DOCKER=1
FROM ${BASE} AS base

# Add backend server - Application Layer
ARG JAR_FILE=./app/server/dist/server-*.jar
Expand All @@ -13,19 +12,11 @@ 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 '{}' ';'
# Create the plugins directory
RUN mkdir -p ./editor ./rts ./backend/plugins

# Ensure all custom command-scripts have executable permission
chmod +x /opt/bin/*
END

#Add the jar to the container
COPY deploy/docker/fs /
# Add the jar to the container
COPY ${JAR_FILE} backend/server.jar
COPY ${PLUGIN_JARS} backend/plugins/

Expand All @@ -35,10 +26,25 @@ 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
# Copy package.json and optionally package-lock.json
COPY app/client/package*.json ./editor/

ENV PATH /appsmith/utils/node_modules/.bin:/java/bin:/opt/node/bin:$PATH

# Install dependencies using npm install (locally to regenerate package-lock.json)
# Check if package-lock.json exists and use it if present
RUN if [ -f package-lock.json ]; then \
echo "Using package-lock.json"; \
yarn ci; \
else \
echo "Warning: package-lock.json not found, using package.json"; \
yarn install; \
fi

# Additional setup and permissions
RUN cd ./utils && npm install --only=prod && npm install --only=prod -g . && cd - \
&& chmod +x /opt/bin/* *.sh /watchtower-hooks/*.sh \
&& chmod +x /deploy/docker/fs/entrypoint.sh \
&& chmod +x *.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 \
Expand All @@ -50,6 +56,6 @@ LABEL com.centurylinklabs.watchtower.lifecycle.pre-update=/watchtower-hooks/pre-

EXPOSE 80
EXPOSE 443
ENTRYPOINT [ "/opt/appsmith/entrypoint.sh" ]
HEALTHCHECK --interval=15s --timeout=15s --start-period=45s CMD "/opt/appsmith/healthcheck.sh"
# ENTRYPOINT [ "/opt/appsmith/entrypoint.sh" ]
HEALTHCHECK --interval=15s --timeout=15s --start-period=45s CMD "/opt/appsmith/healthcheck.seh"
CMD ["/usr/bin/supervisord", "-n"]