feat(chalice): included sourcemaps_reader

It's not advised to run multiple processes in a single docker container.
In Kubernetes we can run this as sidecar, but other platforms such as
Heroku, and vanilla docker doesn't support such feature. So till we
figure out better solution, this is the workaround.
This commit is contained in:
Rajesh Rajendran 2021-05-21 21:30:44 +05:30
parent 13f012ffde
commit 8db1b9d47e
No known key found for this signature in database
GPG key ID: F9F6FCAB8BACB638
2 changed files with 15 additions and 1 deletions

View file

@ -4,6 +4,14 @@ WORKDIR /work
COPY . .
RUN pip install -r requirements.txt -t ./vendor --upgrade
RUN pip install chalice==1.22.2
# Installing Nodejs
RUN apt update && apt install -y curl && \
curl -fsSL https://deb.nodesource.com/setup_12.x | bash - && \
apt install -y nodejs && \
apt remove --purge -y curl && \
rm -rf /var/lib/apt/lists/* && \
cd sourcemaps_reader && \
npm install
# Add Tini
# Startup daemon
@ -13,4 +21,4 @@ ENV ENTERPRISE_BUILD ${envarg}
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /tini
RUN chmod +x /tini
ENTRYPOINT ["/tini", "--"]
CMD python env_handler.py && chalice local --no-autoreload --host 0.0.0.0 --stage ${ENTERPRISE_BUILD}
CMD ./entrypoint.sh

6
api/entrypoint.sh Executable file
View file

@ -0,0 +1,6 @@
#!/bin/bash
cd sourcemaps_reader
nohup node server.js &> /tmp/sourcemaps_reader.log &
cd ..
python env_handler.py
chalice local --no-autoreload --host 0.0.0.0 --stage ${ENTERPRISE_BUILD}