forked from cecpk/RocketMAD
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
56 lines (41 loc) · 1.57 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# Basic docker image for RocketMap
# Usage:
# docker build -t rocketmap .
# docker run -d -P rocketmap -a ptc -u YOURUSERNAME -p YOURPASSWORD -l "Seattle, WA" -st 10 --gmaps-key CHECKTHEWIKI
# Stage 0: build static assets using Node
FROM node:18-slim
WORKDIR /usr/src/app
COPY package.json /usr/src/app/
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
ca-certificates git unzip \
python3 \
build-essential\
&& npm install
COPY Gruntfile.js static01.zip /usr/src/app/
COPY static /usr/src/app/static
# Build the assets - later we'll copy it to the app's image
RUN npm run build
# Stage 1: Build the actual image
FROM python:3.10-slim
# Working directory for the application
WORKDIR /usr/src/app
COPY requirements.txt /usr/src/app
# Install app's dependencies
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
build-essential curl imagemagick \
&& pip install --no-cache-dir dumb-init \
&& pip install --no-cache-dir -r requirements.txt \
&& rm -rf /var/lib/apt/lists/* \
&& apt-get purge -y --auto-remove build-essential
# Default port the webserver runs on
EXPOSE 5000
# Copy everything to the working directory (Python files, templates, config) in one go.
COPY . /usr/src/app
# Remove samples to allow mounting config directory from outside the container
RUN rm -rf /usr/src/app/config
# Copy compiled statics from stage 0
COPY --from=0 /usr/src/app/static /usr/src/app/static
# Set Entrypoint with hard-coded options
ENTRYPOINT ["dumb-init", "-r", "15:2", "python", "./runserver.py", "--host", "0.0.0.0"]