Skip to content

Commit fbb3076

Browse files
committed
Dockerfiles
1 parent 5899774 commit fbb3076

File tree

5 files changed

+116
-11
lines changed

5 files changed

+116
-11
lines changed

docker-compose.yml

Whitespace-only changes.

polling-app-client/Dockerfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
FROM nginx:1.15.10-alpine
2+
COPY ./build /var/www
3+
COPY nginx.conf /etc/nginx/nginx.conf
4+
EXPOSE 80
5+
ENTRYPOINT ["nginx","-g","daemon off;"]

polling-app-client/nginx.conf

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# auto detects a good number of processes to run
2+
worker_processes auto;
3+
4+
#Provides the configuration file context in which the directives that affect connection processing are specified.
5+
events {
6+
# Sets the maximum number of simultaneous connections that can be opened by a worker process.
7+
worker_connections 8000;
8+
# Tells the worker to accept multiple connections at a time
9+
multi_accept on;
10+
}
11+
12+
13+
http {
14+
# what times to include
15+
include /etc/nginx/mime.types;
16+
# what is the default one
17+
default_type application/octet-stream;
18+
19+
# Sets the path, format, and configuration for a buffered log write
20+
log_format compression '$remote_addr - $remote_user [$time_local] '
21+
'"$request" $status $upstream_addr '
22+
'"$http_referer" "$http_user_agent"';
23+
24+
server {
25+
# listen on port 80
26+
listen 80;
27+
# save logs here
28+
access_log /var/log/nginx/access.log compression;
29+
30+
# where the root here
31+
root /var/www;
32+
# what file to server as index
33+
index index.html index.htm;
34+
35+
location / {
36+
# First attempt to serve request as file, then
37+
# as directory, then fall back to redirecting to index.html
38+
try_files $uri $uri/ /index.html;
39+
}
40+
41+
# Media: images, icons, video, audio, HTC
42+
location ~* \.(?:jpg|jpeg|gif|png|ico|cur|gz|svg|svgz|mp4|ogg|ogv|webm|htc)$ {
43+
expires 1M;
44+
access_log off;
45+
add_header Cache-Control "public";
46+
}
47+
48+
# Javascript and CSS files
49+
location ~* \.(?:css|js)$ {
50+
try_files $uri =404;
51+
expires 1y;
52+
access_log off;
53+
add_header Cache-Control "public";
54+
}
55+
56+
# Any route containing a file extension (e.g. /devicesfile.js)
57+
location ~ ^.+\..+$ {
58+
try_files $uri =404;
59+
}
60+
}
61+
}

polling-app-client/package-lock.json

Lines changed: 30 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

polling-app-server/Dockerfile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Start with a base image containing Java runtime
2+
FROM openjdk:8-jdk-alpine
3+
4+
# Add Maintainer Info
5+
LABEL maintainer="[email protected]"
6+
7+
# Add a volume pointing to /tmp
8+
VOLUME /tmp
9+
10+
# Make port 8080 available to the world outside this container
11+
EXPOSE 8080
12+
13+
# The application's jar file
14+
ARG JAR_FILE=target/polls-0.0.1-SNAPSHOT.jar
15+
16+
# Add the application's jar to the container
17+
ADD ${JAR_FILE} app.jar
18+
19+
# Run the jar file
20+
ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","/app.jar"]

0 commit comments

Comments
 (0)