Skip to content

Commit

Permalink
feat: gh action and dockerfile added
Browse files Browse the repository at this point in the history
  • Loading branch information
mohammad5305 committed Dec 13, 2023
1 parent ac866d7 commit 32784f2
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 0 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: build
on:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
# - name: docker build
# run : |
# docker build -t crawl:latest .
- name: build
run : |
docker buildx build -t crawl:latest --platform linux/i386,linux/x86_64 .
- name: Setup tmate session
uses: mxschmitt/action-tmate@v3

27 changes: 27 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
FROM alpine:3.16 as build

ENV CRAWL_REPO="https://github.com/crawl/crawl.git"
ENV APP_DEPS="bzip2 git lua-dev python3 python3-dev py3-pip py3-yaml ncurses-terminfo-base libc-utils sqlite-libs pcre-dev musl-locales lsof sudo autoconf bison build-base flex git ncurses-dev sqlite-dev zlib-dev pkgconf binutils freetype-dev libpng-dev ttf-dejavu advancecomp pngcrush libexecinfo-dev"

RUN apk update && apk add --no-cache $APP_DEPS

RUN git clone --filter=tree:0 ${CRAWL_REPO} /src/

WORKDIR /src/crawl-ref/source

# related to https://github.com/crawl/crawl/issues/2446
RUN sed -i "/#define BACKTRACE_SUPPORTED/d" crash.cc
RUN make install -j$(nproc) EXTERNAL_DEFINES="-lexecinfo" DESTDIR=/app/ USE_DGAMELAUNCH=y WEBTILES=y

FROM python:alpine3.19

COPY --from=build /app /app
COPY --from=build /src/crawl-ref/source/util /app/util
COPY --from=build /src/crawl-ref/source/webserver /app/webserver

RUN pip install --no-cache-dir -r /app/webserver/requirements/base.py3.txt

RUN cp /app/bin/crawl /app/crawl

EXPOSE 8080
CMD python /app/webserver/server.py

0 comments on commit 32784f2

Please sign in to comment.