-
-
Notifications
You must be signed in to change notification settings - Fork 7
/
Dockerfile
51 lines (38 loc) · 1.39 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
# base image
FROM ubuntu:22.04
# configure env
ENV DEBIAN_FRONTEND 'noninteractive'
# update apt, install core apt dependencies and delete the apt-cache
# note: this is done in one command in order to keep down the size of intermediate containers
ADD packages.sh .
RUN bash packages.sh
# configure locale
RUN locale-gen 'en_US.UTF-8'
ENV LANG 'en_US.UTF-8'
ENV LANGUAGE 'en_US:en'
ENV LC_ALL 'en_US.UTF-8'
# maintainer information
LABEL maintainer="[email protected]"
# configure directories
RUN mkdir -p '/data' '/code/pelias'
# configure volumes
VOLUME "/data"
# configure git
RUN git config --global 'user.email' '[email protected]'
RUN git config --global 'user.name' 'Pelias Docker'
# install nodejs
ENV NODE_VERSION='16.20.1'
RUN git clone 'https://github.com/isaacs/nave.git' /code/nave && /code/nave/nave.sh 'usemain' "${NODE_VERSION}" && rm -rf ~/.nave /code/nave
# add global install dir to $NODE_PATH
ENV NODE_PATH="/usr/local/lib/node_modules:$NODE_PATH"
# node version is so old it requires an older version of npm (max version 9)
# https://stackoverflow.com/a/77024158
# ensure NPM is up to date
RUN npm i npm@9 -g
# get ready for pelias config with an empty file
ENV PELIAS_CONFIG '/code/pelias.json'
RUN echo '{}' > '/code/pelias.json'
# add a pelias user
RUN useradd -ms /bin/bash pelias
# ensure symlinks, pelias.json, and anything else are owned by pelias user
RUN chown pelias:pelias /data /code -R