La directory del progetto è il luogo consigliato:
In your project directory, create a file named Dockerfile and paste the following:
FROM python:3.4-alpine
ADD . /code
WORKDIR /code
RUN pip install -r requirements.txt
CMD ["python", "app.py"]
La procedura consigliata è utilizzare le variabili d'ambiente . Ad esempio:
COMPOSE_PROJECT_NAME=OpenTOSCA
COMPOSE_CONVERT_WINDOWS_PATHS=1
PUBLIC_HOSTNAME=container
per evitare problemi specifici del sistema operativo con il path-finding:
It appears the volumes parameter for docker provider tries to sync
using the path formatting of the host machine instead of the host_vm created to build and run the docker containers from.
e per utilizzare commenti e script di shell specifici del sistema operativo per astrarre le convenzioni di denominazione del sistema host:
container-repository:
# volumes:
# - <path on host system>:/var/opentosca/repository
e per utilizzare le sostituzioni:
Info: We use the override feature of Docker Compose to provide different configurations for certain use cases.
Basic override file with common configuration settings for our environment:
_docker-compose.override.yml
Simply, make a copy and modify it to your needs:
cp _docker-compose.override.yml docker-compose.override.yml
Settings from docker-compose.override.yml
are applied automatically when using docker-compose up
.
Riferimenti