Skip to content

Commit 13510ad

Browse files
Heroku complient Dockerfile
1 parent 7d2b58c commit 13510ad

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

Dockerfile

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
# Android builds currently work well with JDK 17 for modern AGP
22
FROM eclipse-temurin:21-jdk-jammy
33

4+
# Limit Java memory usage (adjust values as needed)
5+
ENV JAVA_OPTS="-Xmx256m -Xms128m -XX:MaxMetaspaceSize=128m"
6+
ENV GRADLE_OPTS="-Xmx256m -Xms128m -XX:MaxMetaspaceSize=128m -Dorg.gradle.daemon=false -Dorg.gradle.parallel=false -Dorg.gradle.workers.max=1 -Dorg.gradle.jvmargs=-Xmx256m"
7+
48
ARG ANDROID_SDK_ROOT=/opt/android-sdk
59
ENV ANDROID_SDK_ROOT=${ANDROID_SDK_ROOT}
610
ENV ANDROID_HOME=${ANDROID_SDK_ROOT}
@@ -93,11 +97,10 @@ RUN CHROME_PATH=$(find /root/.cache/puppeteer -name chrome -type f | head -n 1)
9397
# Create entrypoint script that sources the environment
9498
RUN echo '#!/bin/sh\n\
9599
export PUPPETEER_EXECUTABLE_PATH=$(find /root/.cache/puppeteer -name chrome -type f | head -n 1)\n\
96-
exec node /app/dist/index.js "$@"' > /entrypoint.sh && \
100+
exec "$@"' > /entrypoint.sh && \
97101
chmod +x /entrypoint.sh
98102

99103
EXPOSE 4000
100104

101105
ENTRYPOINT ["/entrypoint.sh"]
102-
103-
CMD ["serve", "--port", "4000"]
106+
CMD ["sh", "-c", "node /app/dist/index.js serve --port ${PORT:-4000}"]

0 commit comments

Comments
 (0)