feat: Convert cloud dockerfile to work without build step

This commit is contained in:
Faruk AYDIN
2024-01-12 16:33:58 +01:00
parent 188b6c2fe5
commit 115a993cd2
2 changed files with 16 additions and 9 deletions

View File

@@ -1,17 +1,22 @@
# syntax=docker/dockerfile:1
FROM node:18-alpine
WORKDIR /automatisch
ENV PORT 3000
RUN ls -lna
RUN \
apk --no-cache add --virtual build-dependencies python3 build-base git
# copy the app, note .dockerignore
COPY . ./
RUN git clone -b models-js https://github.com/automatisch/automatisch.git
RUN yarn
RUN yarn lerna bootstrap
RUN yarn lerna run --scope=@*/{web,backend,cli} build
WORKDIR /automatisch
RUN yarn install
RUN cd packages/web && yarn build
RUN \
rm -rf /usr/local/share/.cache/ && \
apk del build-dependencies
COPY ./docker/entrypoint-cloud.sh /entrypoint-cloud.sh

View File

@@ -2,8 +2,10 @@
set -e
cd packages/backend
if [ -n "$WORKER" ]; then
yarn automatisch start-worker
yarn start:worker
else
yarn automatisch start
yarn start
fi