diff --git a/.github/workflows/runtime.yml b/.github/workflows/runtime.yml index 9a18fbe..3a0c259 100644 --- a/.github/workflows/runtime.yml +++ b/.github/workflows/runtime.yml @@ -20,8 +20,8 @@ jobs: - name: Push to Docker Hub run: | - echo "${{ secrets.DOCKER_HUB_TOKEN }}" | docker login --username snoyberg --password-stdin - IMAGE_ID=snoyberg/snoyman.com + echo "${{ secrets.DOCKER_HUB_TOKEN }}" | docker login --username fpcojenkins --password-stdin + IMAGE_ID=fpco/stackage-server-prod docker tag image $IMAGE_ID docker push $IMAGE_ID IMAGE_ID=$IMAGE_ID:$GITHUB_SHA diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..8cc8107 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,12 @@ +FROM docker.pkg.github.com/fpco/stackage-server/base-build:dcc4ec7213daed35b27629b894c06a9769b9acff as build-app + +RUN mkdir -p /artifacts/bin +COPY . /src +RUN stack install --stack-yaml /src/stack.yaml --local-bin-path /artifacts/bin + +FROM docker.pkg.github.com/fpco/stackage-server/base-run:dcc4ec7213daed35b27629b894c06a9769b9acff + +COPY --from=build-app /src/config/ /app/config/ +COPY --from=build-app /src/static/ /app/static/ +COPY --from=build-app /artifacts/bin/stackage-server /usr/local/bin/stackage-server +COPY --from=build-app /artifacts/bin/stackage-server-cron /usr/local/bin/stackage-server-cron diff --git a/etc/docker/.gitignore b/etc/docker/.gitignore deleted file mode 100644 index 742d8e4..0000000 --- a/etc/docker/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/_artifacts/ diff --git a/etc/docker/Dockerfile b/etc/docker/Dockerfile deleted file mode 100644 index d729711..0000000 --- a/etc/docker/Dockerfile +++ /dev/null @@ -1,12 +0,0 @@ -#fpco/stack-run:lts-5 -FROM fpco/stack-run@sha256:4b170ac899755a89c0295b7726c5530015211055125f6e3f6c5b902cb3e9b74b - -RUN export DEBIAN_FRONTEND=noninteractive && \ - apt-get update && \ - wget -qO- https://get.haskellstack.org/ | sh -x && \ - unset DEBIAN_FRONTEND - -COPY _artifacts/config/ /app/config/ -COPY _artifacts/static/ /app/static/ -COPY _artifacts/stackage-server /usr/local/bin/stackage-server -COPY _artifacts/stackage-server-cron /usr/local/bin/stackage-server-cron