From f6328194366b1acaf1a01f874ec04f10f1436ff3 Mon Sep 17 00:00:00 2001 From: Agnieszka Figiel Date: Thu, 19 Oct 2023 11:24:13 +0200 Subject: [PATCH] Fixes for running docker locally --- cms/Dockerfile | 8 +++++--- cms/Dockerfile.prod | 2 +- cms/docker-compose.yml | 8 ++++++++ cms/entrypoint.sh | 2 ++ 4 files changed, 16 insertions(+), 4 deletions(-) create mode 100644 cms/docker-compose.yml diff --git a/cms/Dockerfile b/cms/Dockerfile index 04392bba..7a167b23 100644 --- a/cms/Dockerfile +++ b/cms/Dockerfile @@ -1,5 +1,5 @@ FROM node:18.17-bullseye-slim -# Install dependencies + RUN apt-get update -y && \ apt-get upgrade -y && \ apt-get install -y \ @@ -11,10 +11,12 @@ RUN apt-get update -y && \ libpng-dev \ nasm bash \ libvips-dev \ + git \ && apt-get clean + ENV NODE_ENV development -WORKDIR /app/ +WORKDIR /app COPY .yarn ./.yarn COPY config ./config @@ -37,4 +39,4 @@ RUN yarn install ENV PATH /app/node_modules/.bin:$PATH EXPOSE 1337 -ENTRYPOINT ["/app/cms/entrypoint.sh"] +ENTRYPOINT ["/app/entrypoint.sh"] diff --git a/cms/Dockerfile.prod b/cms/Dockerfile.prod index cf42ea40..5ce911aa 100644 --- a/cms/Dockerfile.prod +++ b/cms/Dockerfile.prod @@ -1,5 +1,5 @@ -# Build all the things FROM node:18.17-bullseye-slim as build + RUN apt-get update -y && \ apt-get upgrade -y && \ apt-get install -y \ diff --git a/cms/docker-compose.yml b/cms/docker-compose.yml new file mode 100644 index 00000000..673cd6d9 --- /dev/null +++ b/cms/docker-compose.yml @@ -0,0 +1,8 @@ +version: "3.9" # optional since v1.27.0 +services: + cms: + build: . + ports: + - "1337:1337" + extra_hosts: + - "host.docker.internal:host-gateway" diff --git a/cms/entrypoint.sh b/cms/entrypoint.sh index 00a4763d..94d96ba6 100755 --- a/cms/entrypoint.sh +++ b/cms/entrypoint.sh @@ -11,6 +11,8 @@ case "${NODE_ENV}" in exec yarn test ;; production) + echo "Import config" + yarn config-sync import -y echo "Running Production Server" exec yarn start ;;