This repository has been archived by the owner on Jan 31, 2023. It is now read-only.
forked from aaact-aatia/a11y-req
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
69 lines (43 loc) · 1.55 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
61
62
63
64
FROM node:12
ENV NODE_ENV "production"
ENV POPULATE_DB "true"
# Change me in production
ENV DB_URI "mongodb://127.0.0.1/a11y-req"
ENV BASIC_AUTH_USERNAME "admin"
ENV BASIC_AUTH_PASSWORD "admin"
ENV WAIT_FOR_MONGO "true"
ENV WAIT_HOSTS "mongodb://127.0.0.1/a11y-req"
# Installing NGINX for reverse proxy
RUN apt update && \
apt install -y nginx && \
rm /etc/nginx/sites-available/default && \
rm /etc/nginx/sites-enabled/default
# dos2unix used to convert scripts written on windows systems to unix formats
RUN apt-get install -y dos2unix
RUN mkdir /home/app
# install node process manager pm2
RUN npm install -g pm2
WORKDIR /home/app
SHELL ["/bin/bash", "-c"]
RUN wget -q https://fastdl.mongodb.org/tools/db/mongodb-database-tools-debian92-x86_64-100.0.2.tgz && \
tar -xzf mongodb-database-tools-debian92-x86_64-100.0.2.tgz && \
mv mongodb-database-tools-debian92-x86_64-100.0.2 mongotools && \
chmod 777 ./mongotools/bin/mongorestore
RUN apt-get install -y netcat
ADD https://github.com/ufoscout/docker-compose-wait/releases/download/2.2.1/wait ./wait
RUN chmod +x ./wait
COPY ./nginx ./nginx
# copying over nginx vhost to appropriate location and testing configuration
RUN dos2unix ./nginx/default.conf && \
mv ./nginx/default.conf /etc/nginx/sites-enabled/default && \
nginx -t
# copy over application files
COPY . .
# install dependencies
RUN npm install
RUN dos2unix ./scripts/start.sh
# make startup script executable
RUN chmod 777 ./scripts/start.sh
# make the script to be the entrypoint
ENTRYPOINT [ "/bin/bash", "scripts/start.sh" ]
EXPOSE 80