diff --git a/Dockerfile b/Dockerfile index d018b27..ce043ad 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,6 +13,12 @@ RUN apk add --no-cache \ # import work files WORKDIR /app + +COPY package.json ./ +COPY scripts ./scripts + +RUN yarn install --no-lockfile + COPY . . # build production files ARG SWOB_BE_HOST @@ -23,16 +29,17 @@ ARG SWOB_SSL_ENABLE ARG SWOB_SSL_CRT_FILE ARG SWOB_SSL_KEY_FILE -RUN export SWOB_BE_HOST=${SWOB_BE_HOST} \ - SWOB_GS_HOST=${SWOB_GS_HOST} \ - SWOB_RECAPTCHA_ENABLE=${SWOB_RECAPTCHA_ENABLE} \ - SWOB_RECAPTCHA_SITE_KEY=${SWOB_RECAPTCHA_SITE_KEY} \ - SWOB_SSL_ENABLE=${SWOB_SSL_ENABLE} \ - SWOB_SSL_CRT_FILE=${SWOB_SSL_CRT_FILE} \ - SWOB_SSL_KEY_FILE=${SWOB_SSL_KEY_FILE} \ - SWOB_SSL_ENABLE=${SWOB_SSL_ENABLE} +ENV SWOB_BE_HOST=${SWOB_BE_HOST} +ENV SWOB_GS_HOST=${SWOB_GS_HOST} +ENV SWOB_RECAPTCHA_ENABLE=${SWOB_RECAPTCHA_ENABLE} +ENV SWOB_RECAPTCHA_SITE_KEY=${SWOB_RECAPTCHA_SITE_KEY} +ENV SWOB_SSL_ENABLE=${SWOB_SSL_ENABLE} +ENV SWOB_SSL_CRT_FILE=${SWOB_SSL_CRT_FILE} +ENV SWOB_SSL_KEY_FILE=${SWOB_SSL_KEY_FILE} +ENV SWOB_SSL_ENABLE=${SWOB_SSL_ENABLE} -RUN make +RUN ./scripts/create_env.sh && \ + yarn build # base image for apache FROM httpd:2.4 as apache diff --git a/Makefile b/Makefile index 19f2aab..66ee17f 100644 --- a/Makefile +++ b/Makefile @@ -7,7 +7,7 @@ config: build: @echo "[!] Creating production build ..." - yarn install --no-lockfile && \ + yarn install --no-lockfile yarn build deploy: