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:
parent
13f012ffde
commit
8db1b9d47e
2 changed files with 15 additions and 1 deletions
|
|
@ -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
6
api/entrypoint.sh
Executable 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}
|
||||
Loading…
Add table
Reference in a new issue