forked from MidAtlanticPortal/marco-portal2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
58 lines (48 loc) · 1.54 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
57
58
# pull official base image
FROM python:3.9.6-alpine
#FROM alpine:3.14
#FROM python:3.8.10-alpine
# set environment variables
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
# set work directory
WORKDIR /usr/local/apps/madrona-portal
# copy project
COPY ./marco /usr/local/apps/madrona-portal/marco
COPY ./apps /usr/local/apps/madrona-portal/apps
COPY ./assets /usr/local/apps/madrona-portal/assets
COPY ./bower_components /usr/local/apps/madrona-portal/bower_components
COPY ./docker/entrypoint.sh /entrypoint.sh
COPY ./docker/docker-requirements.txt /requirements.txt
COPY ./backups/ /usr/local/apps/madrona-portal/backups
# install dependencies
RUN \
apk update &&\
apk add --no-cache --virtual .build-deps \
autoconf automake make \
musl-dev gcc binutils g++ \
libffi-dev \
pkgconfig openssl \
&&\
apk add --no-cache --update \
python3-dev \
postgresql postgresql-contrib \
postgresql-dev postgresql-libs \
jpeg-dev libjpeg zlib-dev libtool \
libpq gdal gdal-tools geos-dev gdal-dev \
protobuf-c-dev json-c-dev perl libxml2-dev \
proj proj-dev proj-util \
&& \
pip install --upgrade pip &&\
pip install -r /requirements.txt
#&&\
#apk --purge del .build-deps
RUN chmod +x /entrypoint.sh
RUN mkdir -p /vol/web/media
RUN mkdir -p /vol/web/static
RUN adduser -D madrona_user
RUN chown -R madrona_user:madrona_user /vol
RUN chown -R madrona_user:madrona_user /usr/local/apps/madrona-portal
RUN chmod -R 755 /vol/web
USER madrona_user
CMD ["/entrypoint.sh"]