dilipdmn91 commited on
Commit
75f3e5d
1 Parent(s): 6fd8cfc

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +45 -10
Dockerfile CHANGED
@@ -1,14 +1,49 @@
1
- # Use the official Python 3.6 image as a parent image
2
- FROM python:3.6
3
 
4
- # Set environment variable to avoid some of TensorFlow's warnings
5
- ENV TF_CPP_MIN_LOG_LEVEL=2
 
6
 
7
- # Install TensorFlow 1.6
8
- RUN pip install tensorflow==1.6
9
 
10
- # Set working directory in the container
11
- #WORKDIR /app
12
 
13
- # Copy local content into the container
14
- #COPY . /app
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # syntax=docker/dockerfile:1
 
2
 
3
+ # Comments are provided throughout this file to help you get started.
4
+ # If you need more help, visit the Dockerfile reference guide at
5
+ # https://docs.docker.com/engine/reference/builder/
6
 
7
+ ARG PYTHON_VERSION=3.6
8
+ FROM python:${PYTHON_VERSION}-slim as base
9
 
10
+ # Prevents Python from writing pyc files.
11
+ ENV PYTHONDONTWRITEBYTECODE=1
12
 
13
+ # Keeps Python from buffering stdout and stderr to avoid situations where
14
+ # the application crashes without emitting any logs due to buffering.
15
+ ENV PYTHONUNBUFFERED=1
16
+
17
+ WORKDIR /app
18
+
19
+ # Create a non-privileged user that the app will run under.
20
+ # See https://docs.docker.com/develop/develop-images/dockerfile_best-practices/#user
21
+ ARG UID=10001
22
+ RUN adduser \
23
+ --disabled-password \
24
+ --gecos "" \
25
+ --home "/nonexistent" \
26
+ --shell "/sbin/nologin" \
27
+ --no-create-home \
28
+ --uid "${UID}" \
29
+ appuser
30
+
31
+ # Download dependencies as a separate step to take advantage of Docker's caching.
32
+ # Leverage a cache mount to /root/.cache/pip to speed up subsequent builds.
33
+ # Leverage a bind mount to requirements.txt to avoid having to copy them into
34
+ # into this layer.
35
+ RUN --mount=type=cache,target=/root/.cache/pip \
36
+ --mount=type=bind,source=requirements.txt,target=requirements.txt \
37
+ python -m pip install -r requirements.txt
38
+
39
+ # Switch to the non-privileged user to run the application.
40
+ USER appuser
41
+
42
+ # Copy the source code into the container.
43
+ COPY . .
44
+
45
+ # Expose the port that the application listens on.
46
+ EXPOSE 8000
47
+
48
+ # Run the application.
49
+ CMD docker.saliency.cpu