use workdir for build

This commit is contained in:
Jonas Leder 2021-09-26 00:12:02 +02:00
parent c005977218
commit 78b19da093
No known key found for this signature in database
GPG key ID: CC3C488E27DFF5CA

View file

@ -1,17 +1,17 @@
# Bootstrap SCSS
FROM node:lts-alpine AS buildJS
WORKDIR /build
COPY . /build
RUN mkdir /build/public/js
RUN mkdir /build/public/css
COPY . .
RUN mkdir public/js
RUN mkdir public/css
RUN yarn install
RUN yarn compile
# Install PHP dependencies
FROM composer:2 AS composer
WORKDIR /build
COPY --from=buildJS /build /build
RUN cd /build/public/API && composer install
COPY --from=buildJS . .
RUN cd public/API && composer install
# Prepare Webserver
FROM gitlab.jonasled.de/jonasled/apache-php-minimal:latest
@ -25,4 +25,4 @@ RUN apk update && \
# |--------------------------------------------------------------------------
# | copy website from node build
# |--------------------------------------------------------------------------
COPY --from=composer /build/public /var/www/localhost/htdocs/
COPY --from=composer public .