Skip to content

Commit 1bb90f4

Browse files
authored
Merge pull request #1356 from mauke/fix-dockerfile
fix Dockerfile
2 parents 3766ae3 + 35401c2 commit 1bb90f4

File tree

1 file changed

+20
-25
lines changed

1 file changed

+20
-25
lines changed

Dockerfile

Lines changed: 20 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -3,47 +3,42 @@
33
# Build the container
44
# $ docker build . -t siddhu/hackage-server
55
#
6-
# Shell into the container
7-
# $ docker run -it -p 8080:8080 siddhu/hackage-server /bin/bash
8-
#
96
# Run the server
10-
# Docker> # hackage-server run --static-dir=datafiles
7+
# $ docker run -it -p 8080:8080 siddhu/hackage-server
118
#
129

13-
FROM ubuntu:18.04
10+
FROM haskell:9.10.1-slim-bullseye
11+
12+
RUN apt-get update && cabal update
1413

15-
RUN apt-get update
16-
RUN apt-get install -y software-properties-common
17-
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y unzip libicu-dev postfix zlib1g-dev libssl-dev
14+
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y \
15+
libbrotli-dev \
16+
libgd-dev \
17+
libicu-dev \
18+
libssl-dev \
19+
pkg-config \
20+
postfix \
21+
unzip \
22+
zlib1g-dev
1823

19-
RUN apt-add-repository ppa:hvr/ghc
20-
RUN apt-get update
21-
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y ghc-8.2.2 cabal-install-3.0
22-
ENV PATH /opt/ghc/bin:$PATH
23-
RUN cabal v2-update
24-
RUN mkdir /build
2524
WORKDIR /build
2625
ADD hackage-server.cabal cabal.project ./
27-
RUN cabal v2-build --only-dependencies --enable-tests -j
28-
RUN cabal v2-install hackage-repo-tool
26+
RUN cabal build --only-dependencies --enable-tests -j
27+
RUN cabal install hackage-repo-tool
2928
ENV PATH /root/.cabal/bin:$PATH
3029
ADD . ./
3130
RUN hackage-repo-tool create-keys --keys keys
3231
RUN cp keys/timestamp/*.private datafiles/TUF/timestamp.private
3332
RUN cp keys/snapshot/*.private datafiles/TUF/snapshot.private
3433
RUN hackage-repo-tool create-root --keys keys -o datafiles/TUF/root.json
3534
RUN hackage-repo-tool create-mirrors --keys keys -o datafiles/TUF/mirrors.json
36-
RUN cabal v2-build
37-
# tests currently don't pass: the hackage-security work introduced some
38-
# backup/restore errors (though they look harmless)
39-
# see https://github.com/haskell/hackage-server/issues/425
40-
#RUN cabal v2-test
41-
RUN cabal v2-install all
35+
RUN cabal build
36+
#RUN cabal test
37+
RUN cabal install all
4238

4339
# setup server runtime environment
44-
RUN mkdir /runtime
45-
RUN cp -r /build/datafiles /runtime/datafiles
4640
WORKDIR /runtime
41+
RUN cp -r /build/datafiles /runtime/datafiles
4742
RUN hackage-server init --static-dir=datafiles
48-
CMD hackage-server run --static-dir=datafiles
43+
CMD hackage-server run --static-dir=datafiles --ip=0.0.0.0 --base-uri=http://localhost:8080
4944
EXPOSE 8080

0 commit comments

Comments
 (0)