-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
55 lines (43 loc) · 1.51 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
FROM debian:jessie
# Update and upgrade
RUN apt-get update && apt-get upgrade -y
# Install curl, supervisor, nginx
RUN apt-get install --fix-missing -y curl supervisor nginx
# Install nodejs
RUN curl -sL https://deb.nodesource.com/setup_10.x | bash - && \
apt-get install -y nodejs build-essential
# Install mongodb
RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 9DA31620334BD75D9DCB49F368818C72E52529D4 && \
echo "deb http://repo.mongodb.org/apt/debian jessie/mongodb-org/4.0 main" | tee /etc/apt/sources.list.d/mongodb-org-4.0.list && \
apt-get update && \
apt-get install -y mongodb-org && \
mkdir -p /data/db
# Install yarn
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - && \
echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list && \
apt-get update && \
apt-get install yarn
# Create app directory
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
# Setup nginx and mongodb
COPY setup /usr/src/app/setup
RUN bash setup/setup_nginx.sh && \
bash setup/setup_mongo.sh && \
rm -r setup
# Install app dependencies
COPY app/package.json app/yarn.lock /usr/src/app/
RUN yarn
# Copy app
COPY app /usr/src/app
# Setup flag executable
COPY flags/get_flag /usr/bin/
RUN \
chown root:root /usr/bin/get_flag && \
chmod 111 /usr/bin/get_flag && \
chmod u+s /usr/bin/get_flag
# Setup supervisord
RUN mkdir -p /var/log/supervisor
COPY setup/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
EXPOSE 80
CMD ["/usr/bin/supervisord"]