Skip to content

Commit d19ab7e

Browse files
committed
Temp: Disable Docker healthcheck & _ nginx.conf
- Commented out Docker healthcheck to avoid unnecessary retries. - Set Nginx server_name to wildcard (_) to allow all incoming requests. - Commented out build args for simplicity in initial push. This commit will be reverted once the relevant build args are finalised and handled properly.
1 parent bbb672f commit d19ab7e

File tree

4 files changed

+27
-27
lines changed

4 files changed

+27
-27
lines changed

.github/workflows/docker-push-image.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,8 @@ jobs:
7878
cache-from: type=registry,ref=ualbertalib/dmp_roadmap:build-cache-api
7979
# Push the updated build cache to Docker Hub
8080
cache-to: type=registry,ref=ualbertalib/dmp_roadmap:build-cache-api,mode=max
81-
build-args: |
82-
SERVER_NAME=uat.library.ualberta.ca
81+
# build-args: |
82+
# SERVER_NAME=uat.library.ualberta.ca
8383

8484
- name: Build and push the web stage image
8585
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
@@ -95,5 +95,5 @@ jobs:
9595
cache-from: type=registry,ref=ualbertalib/dmp_roadmap:build-cache-web
9696
# Push the updated build cache to Docker Hub
9797
cache-to: type=registry,ref=ualbertalib/dmp_roadmap:build-cache-web,mode=max
98-
build-args: |
99-
SERVER_NAME=uat.library.ualberta.ca
98+
# build-args: |
99+
# SERVER_NAME=uat.library.ualberta.ca

.github/workflows/docker-push-uat-image.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@ jobs:
7979
cache-from: type=registry,ref=ualbertalib/dmp_roadmap:build-cache-api
8080
# Push the updated build cache to Docker Hub
8181
cache-to: type=registry,ref=ualbertalib/dmp_roadmap:build-cache-api,mode=max
82-
build-args: |
83-
SERVER_NAME=uat.library.ualberta.ca
82+
# build-args: |
83+
# SERVER_NAME=uat.library.ualberta.ca
8484

8585
- name: Build and push the web stage image
8686
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
@@ -96,5 +96,5 @@ jobs:
9696
cache-from: type=registry,ref=ualbertalib/dmp_roadmap:build-cache-web
9797
# Push the updated build cache to Docker Hub
9898
cache-to: type=registry,ref=ualbertalib/dmp_roadmap:build-cache-web,mode=max
99-
build-args: |
100-
SERVER_NAME=uat.library.ualberta.ca
99+
# build-args: |
100+
# SERVER_NAME=uat.library.ualberta.ca

Dockerfile.production

+13-13
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,9 @@ rm -rf ${INSTALL_PATH}/node_modules ${INSTALL_PATH}/tmp/*
5353
FROM ruby:$RUBY_VERSION AS api
5454

5555
ARG NODE_VERSION
56-
ARG BASE_URL
57-
ENV INSTALL_PATH=/usr/src/app \
58-
HEALTHCHECK_URL=${BASE_URL}/api/v1/heartbeat
56+
# ARG BASE_URL
57+
ENV INSTALL_PATH=/usr/src/app
58+
# HEALTHCHECK_URL=${BASE_URL}/api/v1/heartbeat
5959

6060
# - postgresql16-client: Required for pg gem to connect to PostgreSQL
6161
# - imagemagick: Required for dragonfly gem to process images
@@ -116,27 +116,27 @@ USER dmpuser
116116

117117
EXPOSE 3000
118118

119-
HEALTHCHECK --interval=30s --timeout=5s --start-period=5s --retries=3 \
120-
CMD wget -qO- $HEALTHCHECK_URL || exit 1
119+
# HEALTHCHECK --interval=30s --timeout=5s --start-period=5s --retries=3 \
120+
# CMD wget -qO- $HEALTHCHECK_URL || exit 1
121121

122122

123123
# nginx stage to serve static assets and proxy requests to api container
124124
FROM nginx:alpine AS web
125125

126-
ARG SERVER_NAME
126+
# ARG SERVER_NAME
127127

128-
ENV SERVER_NAME=$SERVER_NAME \
129-
INSTALL_PATH=/usr/src/app
128+
# ENV SERVER_NAME=$SERVER_NAME \
129+
ENV INSTALL_PATH=/usr/src/app
130130

131131
COPY nginx.conf /etc/nginx/nginx.conf
132132
COPY --from=api ${INSTALL_PATH}/public/assets /usr/share/nginx/html/assets
133133

134134
# Perform envsubst substitution at runtime to set `server_name` value in nginx.conf
135-
CMD envsubst '${SERVER_NAME}' < /etc/nginx/nginx.conf > /tmp/nginx.conf \
136-
# Using a temporary file ensures the configuration is fully generated before Nginx starts.
137-
&& mv /tmp/nginx.conf /etc/nginx/nginx.conf \
138-
# Run Nginx in the foreground, allowing the Docker container to remain active.
139-
&& nginx -g 'daemon off;'
135+
# CMD envsubst '${SERVER_NAME}' < /etc/nginx/nginx.conf > /tmp/nginx.conf \
136+
# # Using a temporary file ensures the configuration is fully generated before Nginx starts.
137+
# && mv /tmp/nginx.conf /etc/nginx/nginx.conf \
138+
# # Run Nginx in the foreground, allowing the Docker container to remain active.
139+
# && nginx -g 'daemon off;'
140140

141141

142142
EXPOSE 80

nginx.conf

+6-6
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,16 @@ http {
55
default_type application/octet-stream;
66

77
# Default server block (404 page)
8-
server {
9-
listen 80 default_server;
10-
server_name _;
11-
return 404;
12-
}
8+
# server {
9+
# listen 80 default_server;
10+
# server_name _;
11+
# return 404;
12+
# }
1313

1414
# Main server block
1515
server {
1616
listen 80;
17-
server_name ${SERVER_NAME};
17+
server_name _;
1818
root /usr/share/nginx/html;
1919

2020
# user nginx to serve static files

0 commit comments

Comments
 (0)