-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile-DEV
70 lines (53 loc) · 1.7 KB
/
Dockerfile-DEV
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
70
### from https://github.com/OSGeo/gdal/tree/master/docker ###
#### Use latest gdal official image
FROM ghcr.io/osgeo/gdal:ubuntu-small-3.9.1
ARG VERSION_APP
ARG TAG_APP
ENV VERSION=$VERSION_APP
ENV TAG=$TAG_APP
ENV DEV_CONTAINER=1
ENV TZ="Europe/Prague"
RUN echo $TZ > /etc/timezone
RUN apt-get update
RUN DEBIAN_FRONTEND="noninteractive" apt-get -y install tzdata
# Update base container install
RUN apt-get -qq update --fix-missing
# Install dependencies
RUN apt-get -qq -y install cron
RUN apt-get -y -qq install nano && apt-get -y -qq install sudo
RUN apt-get update
RUN apt-get install -y python3-pip libgdal-dev locales gettext poppler-utils unrar redis-tools
# Ensure locales configured correctly
RUN locale-gen cs_CZ.utf8
ENV LC_ALL="cs_CZ.utf8"
# Set python aliases for python3
RUN echo "alias python=python3" >> ~/.bashrc
RUN echo "alias pip=pip3" >> ~/.bashrc
COPY ./webclient/requirements.txt .
RUN pip3 install -r requirements.txt --break-system-packages
RUN mkdir /code
COPY ./webclient /code
COPY ./scripts /scripts
COPY ./cert /cert
WORKDIR /code
# Uploaded images
RUN mkdir -p /vol/web/media
# Staic files for the app
RUN mkdir -p /vol/web/static
RUN mkdir -p /vol/web/locale
RUN mkdir -p /vol/web/nginx/data
ADD ./proxy/custom_html /vol/web/nginx/data
RUN userdel ubuntu
RUN echo "DATE:$(date +%Y%m%dT%H%M%S),VERSION:${VERSION}" > /version.txt
RUN adduser user
RUN passwd -d user
RUN usermod -aG sudo user
RUN chown -R user:user /vol /scripts
RUN chmod -R 755 /vol/web /scripts
RUN chmod 777 -R /vol/web/nginx/data
RUN chmod 777 -R /cert/amcr-test-local.crt
RUN chmod 777 -R /cert/amcr-test-local.key
RUN crontab -u user /scripts/crontab.txt
USER user
ENV PYTHONUNBUFFERED=1
CMD ["entrypoint.dev.sh"]