Answer the question
In order to leave comments, you need to log in
Why isn't docker running the command?
I want to use pipenv for django project:
# Dockerfile
FROM python:3.8-slim-buster
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED=1
WORKDIR /app
RUN apt-get update && apt-get -y install libpq-dev gcc python3-dev musl-dev netcat
COPY . /app
RUN pip install pip --upgrade
RUN pip install pipenv
RUN pipenv lock --keep-outdated --requirements > requirements.txt
RUN sh -c 'if [ "$MODE" = "dev" ]; then pipenv lock --dev --requirements >> requirements.txt; fi'
RUN pip install -r requirements.txt
# run entrypoint.sh
RUN chmod a+x ./shell_scripts/entrypoint.sh
ENTRYPOINT ["/app/shell_scripts/entrypoint.sh"]
# docker-compose.yml
version: "3"
services:
app:
container_name: app
build:
context: .
dockerfile: Dockerfile
args:
MODE: dev
env_file: .env
command: python manage.py runserver 0.0.0.0:8000
ports:
- 8000:8000
depends_on:
- db
db:
image: postgres:12.0-alpine
volumes:
- postgres_data:/var/lib/postgresql/data/
env_file:
- .env
volumes:
postgres_data:
pipenv lock --dev --requirements >> requirements.txt
what is my mistake here?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question