-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
60 lines (46 loc) · 1.4 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
59
60
# Set the base image
FROM debian:stretch
LABEL net.guifi.vendor="Fundacio guifi.net"
LABEL version="1.0"
LABEL description="This docker image is ready for \
developing with guifimaps services"
LABEL maintainer="[email protected]"
ENV GMAPS_UNIX_USER guifi
ENV GMAPS_USER_ID 1000
ENV GMAPS_USER_GID 1000
ENV GUIFI_WEB guifi.net
RUN apt-get update && apt-get dist-upgrade -y \
&& apt-get install -y php7.0 \
php7.0-xml wget gosu cgi-mapserver \
git gdal-bin php7.0-curl \
&& apt-get clean \
&& apt-get autoremove \
&& rm -rf /var/lib/apt/lists/*
# Copy apache conf file
COPY ./guifimaps.conf /etc/apache2/sites-available/guifimaps.conf
# Enable new site
RUN a2enmod rewrite \
&& a2enmod cgi \
&& a2dissite 000-default.conf \
&& a2ensite guifimaps.conf
# Creating UNIX User for development (security reasons)
RUN groupadd --gid "${GMAPS_USER_GID}" "${GMAPS_UNIX_USER}" && \
useradd \
--uid ${GMAPS_USER_ID} \
--gid ${GMAPS_USER_GID} \
--create-home \
--shell /bin/bash \
${GMAPS_UNIX_USER}
# Copying script for setting userid and gid (host)
COPY user-mapping.sh /
RUN chmod u+x user-mapping.sh
# Setting Volume
VOLUME /home/$GMAPS_UNIX_USER
# Copying Entrypoint scripts
COPY ./docker-entrypoint.sh /
COPY ./guifimaps-entry.pl /
# Copying utilities
COPY ./refresh.sh /
EXPOSE 80
WORKDIR /home/$GMAPS_UNIX_USER
ENTRYPOINT ["/docker-entrypoint.sh"]