diff --git a/docker/Dockerfile b/docker/Dockerfile index 4fa5e8f7..f4aa6577 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,14 +1,25 @@ # syntax=docker/dockerfile:1 FROM node:18-alpine -WORKDIR /automatisch + +ENV PORT 3000 + +RUN \ + apk --no-cache add --virtual build-dependencies python3 build-base git + +WORKDIR /automatisch + +# copy the app, note .dockerignore +COPY . /automatisch + +RUN yarn + +RUN cd packages/web && yarn build RUN \ - apk --no-cache add --virtual build-dependencies python3 build-base && \ - yarn global add @automatisch/cli@0.10.0 --network-timeout 1000000 && \ rm -rf /usr/local/share/.cache/ && \ apk del build-dependencies -COPY ./entrypoint.sh /entrypoint.sh +COPY ./docker/entrypoint.sh /entrypoint.sh EXPOSE 3000 ENTRYPOINT ["sh", "/entrypoint.sh"] diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh index 60de858c..322a468d 100755 --- a/docker/entrypoint.sh +++ b/docker/entrypoint.sh @@ -2,8 +2,12 @@ set -e +cd packages/backend + if [ -n "$WORKER" ]; then - automatisch start-worker + yarn start:worker else - automatisch start + yarn db:migrate + yarn db:seed:user + yarn start fi