Containerizing app in Docker - sindat/Furcifer GitHub Wiki
In Docker, I have images
and containers
.
Images are basically all the settings that make it ready for the container to launch.
A container is a running instance of the image, that can save it's state.
A docker containerized app will contain Dockerfile in it's directory.
This file will usually have this structure (this is a Python containerized app example):
FROM python:alpine3.7
- base iamge for python
COPY . /app
- copy app the files into some directory, first argument is current directory, second argument is the working directory
WORKDIR /app
- working directory of the app (usually working with the files copied in)
RUN pip install -r requirements.txt
EXPOSE 5000
- expose the port app will listen on
CMD python ./index.py
- workng directory is always referenced as ./ with CMD