diff --git a/tools/docker/images/Dockerfile b/tools/docker/images/Dockerfile index 9d489ef1..dd31b414 100644 --- a/tools/docker/images/Dockerfile +++ b/tools/docker/images/Dockerfile @@ -1,21 +1,23 @@ FROM opdavies/sculpin-serve AS app + +FROM app AS build WORKDIR /app COPY composer.* ./ -RUN composer install +RUN composer install --no-dev COPY app app COPY source source -RUN sculpin generate -e prod +RUN sculpin generate --env prod FROM node:14 AS assets -WORKDIR /node +WORKDIR /app COPY package.json . COPY package-lock.json . RUN npm ci COPY . . RUN npm run production -FROM nginx AS production -COPY tools/docker/images/nginx/root / -WORKDIR /app -COPY --from=app /app/output_prod ./ -COPY --from=assets /node/source/build build +FROM nginx:1 AS production +COPY tools/docker/images/nginx/root/ / +WORKDIR /usr/share/nginx/html +COPY --from=build /app/output_prod ./ +COPY --from=assets /app/source/build build diff --git a/tools/docker/images/nginx/root/etc/nginx/conf.d/default.conf b/tools/docker/images/nginx/root/etc/nginx/conf.d/default.conf index 8f2e1c86..94b9c43a 100644 --- a/tools/docker/images/nginx/root/etc/nginx/conf.d/default.conf +++ b/tools/docker/images/nginx/root/etc/nginx/conf.d/default.conf @@ -391,7 +391,7 @@ server { } location / { - root /app; + root /usr/share/nginx/html; index index.html index.htm; error_page 404 /404.html; }