mirror of
https://github.com/docker/docs.git
synced 2026-03-27 14:28:47 +07:00
Add info about the Expose command (#11137)
This commit is contained in:
@@ -89,8 +89,8 @@ following:
|
||||
RUN apk add --no-cache gcc musl-dev linux-headers
|
||||
COPY requirements.txt requirements.txt
|
||||
RUN pip install -r requirements.txt
|
||||
COPY . .
|
||||
EXPOSE 5000
|
||||
COPY . .
|
||||
CMD ["flask", "run"]
|
||||
|
||||
This tells Docker to:
|
||||
@@ -98,8 +98,9 @@ This tells Docker to:
|
||||
* Build an image starting with the Python 3.7 image.
|
||||
* Set the working directory to `/code`.
|
||||
* Set environment variables used by the `flask` command.
|
||||
* Install gcc so Python packages such as MarkupSafe and SQLAlchemy can compile speedups.
|
||||
* Install gcc and other dependencies
|
||||
* Copy `requirements.txt` and install the Python dependencies.
|
||||
* Add metadata to the image to describe that the container is listening on port 5000
|
||||
* Copy the current directory `.` in the project to the workdir `.` in the image.
|
||||
* Set the default command for the container to `flask run`.
|
||||
|
||||
|
||||
@@ -161,7 +161,7 @@ COPY package.json .
|
||||
# Run the command inside your image filesystem.
|
||||
RUN npm install
|
||||
|
||||
# Inform Docker that the container is listening on the specified port at runtime.
|
||||
# Add metadata to the image to describe which port the container is listening on at runtime.
|
||||
EXPOSE 8080
|
||||
|
||||
# Run the specified command within the container.
|
||||
|
||||
Reference in New Issue
Block a user