using yaml inheritance Im trying to share the env variable between different container. It works but the container dies after creating it.
How can I have the container running after its being created.
I use 'docker-compose up -d' to bring up these containers.
version: '3'
services:
worker: &default
image: 127.0.0.1:5000/stackdemo
env_file:
- .env
# entrypoint: ["/tini", "--", "/common-bash"]
web:
<<: *default
image: 127.0.0.1:5000/stackdemo
build: .
ports:
- "8000:8000"
entrypoint: ["/tini", "--", "/common-bash"]
Also, here is my docker file -
FROM python:3.4-alpine
ADD . /code
WORKDIR /code
ENV TINI_VERSION v0.16.1
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /tini
RUN chmod +x /tini
RUN pip install -r requirements.txt
CMD ["python", "app.py"]
Here is the contents of my common-bash file:
set -e
set USERNAME "test"
exec "$@"