Skip to content

Commit 2ef5355

Browse files
committed
Added basic (very) test support; updated everything
1 parent c3ebc8f commit 2ef5355

File tree

4 files changed

+21
-14
lines changed

4 files changed

+21
-14
lines changed

.github/workflows/main.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ jobs:
1010
runs-on: ubuntu-22.04
1111
steps:
1212
- name: Checkout
13-
uses: actions/checkout@v2
14-
13+
uses: actions/checkout@v3
1514
- name: Build
1615
run: docker build --tag tivix/docker-nginx .
17-
16+
- name: Check
17+
run: docker-compose run proxy test
1818
- name: Push
1919
run: |
2020
echo "${{ secrets.DOCKER_HUB_PASS }}" | docker login -u ${{ secrets.DOCKER_HUB_USER }} --password-stdin

Dockerfile

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
1-
FROM alpine:3.12
1+
FROM alpine:3.17
22

33
RUN apk add --no-cache\
4-
nginx~=1.18 \
5-
py3-pip \
6-
curl \
7-
openssl &&\
4+
'nginx~=1.22' \
5+
'py3-pip~=22.3.1' &&\
86
pip3 install --no-cache-dir \
97
j2cli==0.3.10 \
10-
boto3==1.12.26 &&\
11-
curl -o /usr/local/bin/waitforit -sSL https://github.com/maxcnunes/waitforit/releases/download/v2.4.1/waitforit-linux_amd64 && \
8+
boto3==1.26.114 &&\
9+
wget -q "https://github.com/maxcnunes/waitforit/releases/download/v2.4.1/waitforit-linux_amd64" -O /usr/local/bin/waitforit &&\
1210
chmod +x /usr/local/bin/waitforit &&\
13-
rm -rf /etc/nginx/nginx.conf /etc/nginx/conf.d/*
11+
rm -rf /etc/nginx/nginx.conf /etc/nginx/conf.d/* &&\
12+
mkdir -p /etc/nginx/conf.d/
1413

1514
COPY ./ /code/
1615
COPY docker-entrypoint.sh aws_sm /usr/local/bin/

docker-compose.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ services:
3232
- CSP_OBJECT_SRC=object-src.com
3333
- CSP_MEDIA_SRC=media-src.com
3434
- CSP_FRAME_SRC=frame-src.com
35+
depends_on:
36+
- service_a
37+
- service_b
3538

3639
service_a:
3740
image: containous/whoami

docker-entrypoint.sh

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
mkdir -p /run/nginx/
44
rm -rf /run/nginx/nginx.pid
55

6-
if [ ${#} -eq 0 ]; then
6+
if [ "${#}" -eq 0 ] || [ "${1}" == "test" ]; then
77
echo "Starting docker-nginx"
88

99
j2 --undefined /code/templates/nginx.conf.j2 > /etc/nginx/nginx.conf
@@ -38,8 +38,13 @@ if [ ${#} -eq 0 ]; then
3838
cat ${i}
3939
done
4040
fi
41-
echo "Starting nginx"
42-
exec nginx -g 'daemon off;'
41+
42+
if [ "${1}" == "test" ]; then
43+
nginx -t
44+
else
45+
echo "Starting nginx"
46+
exec nginx -g 'daemon off;'
47+
fi
4348
else
4449
exec "${@}"
4550
fi

0 commit comments

Comments
 (0)