-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
43 lines (34 loc) · 1.25 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
FROM ubuntu:bionic
ENV DEBIAN_FRONTEND=noninteractive
# Install dependencies
RUN apt-get update -y
RUN apt-get install -y openjdk-11-jdk
RUN apt-get install -y wget gnupg
RUN wget -qO - https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add - \
&& echo "deb https://deb.nodesource.com/node_14.x bionic main" | tee /etc/apt/sources.list.d/nodesource.list \
&& apt-get update \
&& apt-get install -y nodejs
RUN wget -qO - https://www.mongodb.org/static/pgp/server-4.2.asc | apt-key add - \
&& echo "deb http://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/4.2 multiverse" | tee /etc/apt/sources.list.d/mongodb-org.list \
&& apt-get update \
&& apt-get install -y mongodb-org-server
RUN apt-get install -y nginx
# Create nginx configuration
COPY proxy/nginx.conf /etc/nginx/sites-available/default
# Create storage folder for mongodb
RUN mkdir -p /data/db
# Install server
COPY server /workdir/server
WORKDIR /workdir/server
RUN ./mvnw package
# Build client
COPY client /workdir/client
WORKDIR /workdir/client
RUN npm install
RUN npm run build
RUN rm -rf /var/www/html && mv build /var/www/html
# Running script
COPY docker-entrypoint.sh /docker-entrypoint.sh
RUN chmod +x /docker-entrypoint.sh
EXPOSE 80
CMD ["/bin/bash", "/docker-entrypoint.sh"]