Skip to content

Commit

Permalink
Merge pull request #1839 from automatisch/dockerfile-revision
Browse files Browse the repository at this point in the history
chore: direct builds in docker
  • Loading branch information
barinali committed Apr 26, 2024
2 parents 79af909 + 3595119 commit 35b2639
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 5 deletions.
17 changes: 14 additions & 3 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,25 @@
# syntax=docker/dockerfile:1
FROM node:18-alpine

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"]
8 changes: 6 additions & 2 deletions docker/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 35b2639

Please sign in to comment.