-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile.local
69 lines (53 loc) · 1.65 KB
/
Dockerfile.local
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
57
58
59
60
61
62
63
64
65
66
67
68
69
FROM node:10 as assets
# Create the folder to work in
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
# Copy over package.json and gang
COPY package.json /usr/src/app
COPY package-lock.json /usr/src/app
# Install dependencies
RUN npm ci
# Bring over the rest of the app
COPY tasks /usr/src/app/tasks
COPY scuole/static_src /usr/src/app/scuole/static_src
# Run build command
RUN ["npm", "run", "build"]
FROM python:3.7-alpine
# Install the geo libs needed to interact with GeoDjango
RUN apk update && \
apk upgrade && \
apk add --no-cache \
--repository http://dl-3.alpinelinux.org/alpine/edge/main/ \
--repository http://dl-3.alpinelinux.org/alpine/edge/testing/ \
gcc \
gdal \
geos \
make \
musl-dev \
proj \
postgresql-dev \
&& rm -rf /var/cache/apk/*
# Symlink for the geo libraries
RUN ln -s /usr/lib/libgeos_c.so.1 /usr/local/lib/libgeos_c.so \
&& ln -s /usr/lib/libgdal.so.20 /usr/lib/libgdal.so
# Install pipenv
RUN pip install --no-cache-dir pipenv
# Create the folder to work in
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
# Grab requirements and install
COPY requirements.txt /usr/src/app/requirements.txt
COPY requirements-dev.txt /usr/src/app/requirements-dev.txt
RUN pip install -r requirements.txt
RUN pip install -r requirements-dev.txt
# Bring over the rest of the app
COPY . /usr/src/app
# Bring over the assets
COPY --from=assets /usr/src/app/scuole/static /usr/src/app/scuole/static
# Let Django know we're using local settings
ENV DJANGO_SETTINGS_MODULE config.settings.local
ENV SECRET_KEY quux
# Expose the port for Docker
EXPOSE 8000
# Local runs gunicorn served on port 8000
ENTRYPOINT ["./docker-entrypoint-local.sh"]