Skip to content

Commit a52bafd

Browse files
Philipp DoernerPhilippMDoerner
Philipp Doerner
authored andcommitted
Moved files around a bit
1 parent 4464644 commit a52bafd

File tree

5 files changed

+34
-12
lines changed

5 files changed

+34
-12
lines changed
+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/bash
2+
# This file contains all commands that shall be run on the docker container on startup
3+
# openrc is there to allow rc-service to run. rc-service manages the nginx server and starts it
4+
# nimstoryfont is the name of the binary that is the webapplication
5+
openrc boot
6+
rc-service nginx start
7+
/nimstoryfont

config/nginx.conf buildFiles/config/nginx.conf

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ http {
2828
#tcp_nopush on;
2929

3030
#keepalive_timeout 0;
31-
keepalive_timeout 65;
31+
keepalive_timeout 600;
3232

3333
#gzip on;
3434

buildFiles/config/nginx.service

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
[Unit]
2+
Description=The nginx HTTP and reverse proxy server
3+
After=network.target remote-fs.target nss-lookup.target
4+
5+
[Service]
6+
Type=forking
7+
PIDFile=/run/nginx.pid
8+
# Nginx will fail to start if /run/nginx.pid already exists but has the wrong
9+
# SELinux context. This might happen when running `nginx -t` from the cmdline.
10+
# https://bugzilla.redhat.com/show_bug.cgi?id=1268621
11+
ExecStartPre=/usr/bin/rm -f /run/nginx.pid
12+
ExecStartPre=/usr/sbin/nginx -t -c /etc/nginx/nginx.conf
13+
ExecStart=/usr/sbin/nginx -c /etc/nginx/nginx.conf
14+
ExecReload=/bin/kill -s HUP $MAINPID
15+
KillSignal=SIGQUIT
16+
TimeoutStopSec=5
17+
KillMode=process
18+
PrivateTmp=true
19+
20+
[Install]
21+
WantedBy=multi-user.target

config/dockerStartScript.sh

-5
This file was deleted.

dockerfile

+5-6
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@ FROM frolvlad/alpine-glibc
22

33
# Install dependencies
44
RUN apk update
5-
RUN apk add --no-cache nginx openrc
6-
RUN apk add --no-cache sqlite-libs
5+
RUN apk add --no-cache openrc nginx sqlite-libs
76

87
# Expose Ports -- Mostly documentation for later
98
#EXPOSE 80/tcp
@@ -12,8 +11,8 @@ RUN apk add --no-cache sqlite-libs
1211

1312
# Copy necessary files
1413
COPY ./nimstoryfont .
15-
COPY ./config/nginx.conf /etc/nginx/nginx.conf
16-
COPY ./config/dockerSettings.json /settings.json
14+
COPY ./buildFiles/config/nginx.conf /etc/nginx/nginx.conf
15+
COPY ./buildFiles/config/dockerSettings.json /settings.json
1716
RUN chmod 777 /settings.json
1817

1918
# Setup necessary directories
@@ -27,10 +26,10 @@ RUN mkdir /frontend
2726
# Mount external directories
2827

2928
#Startup command
30-
COPY ./config/dockerStartScript.sh .
29+
COPY ./buildFiles/config/dockerStartScript.sh .
3130
RUN chmod +x /dockerStartScript.sh
3231

33-
CMD ["/dockerStartScript.sh"]
32+
# CMD ["/dockerStartScript.sh"]
3433

3534
## https://www.tutorialspoint.com/how-do-i-get-into-a-docker-container-s-shell
3635
## https://www.youtube.com/watch?v=SnSH8Ht3MIc

0 commit comments

Comments
 (0)