From 365787e56855f1d335908854d0bc0b00974d5ed1 Mon Sep 17 00:00:00 2001 From: Sara Lambert Date: Mon, 7 Oct 2024 16:13:00 -0500 Subject: [PATCH 1/4] feat: added Docker recipe for building + running Discovery App --- .dockerignore | 4 ++++ Dockerfile | 19 +++++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 .dockerignore create mode 100644 Dockerfile diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 00000000..6785a73a --- /dev/null +++ b/.dockerignore @@ -0,0 +1,4 @@ +node_modules/ +out/ +Dockerfile +.next/ diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..0e4f8e16 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,19 @@ +# Start with NodeJS 20 LTS +FROM node:20 AS build +WORKDIR /usr/app/ + +# Install dependencies +ARG YARN_TIMEOUT=600000 +COPY package.json yarn.lock . +RUN yarn install --network-timeout ${YARN_TIMEOUT} + +# Build app from source +COPY . . +RUN yarn build + + +# Copy built files to NGINX +FROM nginx:alpine AS runtime +RUN rm -rf /usr/share/nginx/html +COPY --from=build /usr/app/out /usr/share/nginx/html + From ffa72c22eae99d29c05b285058221b84cf438944 Mon Sep 17 00:00:00 2001 From: Sara Lambert Date: Mon, 7 Oct 2024 16:19:45 -0500 Subject: [PATCH 2/4] feat: added Docker Compose file for easier build workflow --- docker-compose.yml | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 docker-compose.yml diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 00000000..f7b16ad9 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,9 @@ +services: + + discovery-app: + container_name: sdoh-discovery-app + image: herop/sdoh-discovery-app + build: + context: . + ports: + - 8080:80 From c4b56f347a49134e273b9203c14dc006277c6f97 Mon Sep 17 00:00:00 2001 From: Sara Lambert Date: Tue, 8 Oct 2024 15:58:38 -0500 Subject: [PATCH 3/4] Rename image + service --- docker-compose.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index f7b16ad9..3b2424f1 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,8 +1,8 @@ services: discovery-app: - container_name: sdoh-discovery-app - image: herop/sdoh-discovery-app + container_name: sdoh-homepage + image: herop/sdoh-homepage build: context: . ports: From 0b8bd0b8ae3c0efe59ce82ebb3455a9306a013ac Mon Sep 17 00:00:00 2001 From: Sara Lambert Date: Tue, 8 Oct 2024 15:59:47 -0500 Subject: [PATCH 4/4] Rename image + service --- docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index 3b2424f1..37b762d6 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,6 +1,6 @@ services: - discovery-app: + homepage: container_name: sdoh-homepage image: herop/sdoh-homepage build: