-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
36 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,45 @@ | ||
FROM node:9.5-alpine as builder | ||
RUN apk add --update git python make g++ libnotify openssl | ||
RUN npm install -g gulp-cli | ||
|
||
# SSL self-signed certificate for localhost. | ||
RUN openssl genrsa -des3 -passout pass:x -out server.pass.key 2048 && \ | ||
openssl rsa -passin pass:x -in server.pass.key -out server.key && \ | ||
openssl req -new -key server.key -out server.csr -subj "/C=US/ST=California/L=California/O=localhost/OU=localhost/CN=localhost" && \ | ||
openssl x509 -req -sha256 -days 365 -in server.csr -signkey server.key -out server.crt | ||
|
||
WORKDIR /etherwallet | ||
ADD . /etherwallet | ||
RUN apk add --update git python make g++ libnotify | ||
RUN npm install -g gulp-cli | ||
RUN npm install | ||
RUN npm run dist | ||
|
||
|
||
FROM nginx | ||
|
||
RUN echo "server {\ | ||
listen 443 ssl; \ | ||
ssl on;\ | ||
ssl_certificate /opt/ssl/server.crt;\ | ||
ssl_certificate_key /opt/ssl/server.key;\ | ||
ssl_session_timeout 5m; \ | ||
ssl_session_cache shared:SSL:10m; \ | ||
ssl_protocols TLSv1 TLSv1.1 TLSv1.2; \ | ||
ssl_ciphers 'EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH'; \ | ||
ssl_prefer_server_ciphers on; \ | ||
server_name localhost; \ | ||
location / { \ | ||
root /usr/share/nginx/html; \ | ||
index index.html index.htm; \ | ||
}\ | ||
error_page 500 502 503 504 /50x.html;\ | ||
location = /50x.html {\ | ||
root /usr/share/nginx/html;\ | ||
}\ | ||
}" > /etc/nginx/conf.d/ssl.conf | ||
|
||
COPY --from=builder /etherwallet/dist /usr/share/nginx/html | ||
COPY --from=builder /server.crt /opt/ssl/server.crt | ||
COPY --from=builder /server.key /opt/ssl/server.key | ||
|
||
EXPOSE 80 | ||
EXPOSE 443 |