forked from aly-lmao/womginx
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
21 lines (16 loc) · 883 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
FROM ubuntu:18.04
# install nginx, git, and curl
RUN apt-get update && apt-get install -y nginx git curl
# install nodejs
RUN curl -sL https://deb.nodesource.com/setup_14.x | bash - && apt-get install -y nodejs
# clone repo
RUN git clone --recursive https://github.com/binary-person/womginx /opt/womginx
# build womginx, modify nginx.conf, and copy it to /etc/nginx/nginx.conf
RUN cd /opt/womginx/public/wombat && npm install && npm run build-prod && cd ..\
&& sed -i -e "s/\/home\/binary\/womginx\/public/$(pwd | sed -e 's/\//\\\//g')/g" ../nginx.conf\
&& cp ../nginx.conf /etc/nginx/nginx.conf
# remove all ssl entries and replace 'listen 80' with 'listen $PORT'
CMD sed -i '/ssl_certificate/d' /etc/nginx/nginx.conf\
&& sed -i '/listen 443/d' /etc/nginx/nginx.conf\
&& sed -i -e "s/listen 80/listen $PORT/" /etc/nginx/nginx.conf\
&& nginx -g "daemon off;"