1+ FROM  ubuntu:bionic-20200219 AS tmp
2+ WORKDIR  /build
3+ RUN  apt-get update && apt-get install -y curl wget zip
4+ 
5+ RUN  ARCH=$(dpkg --print-architecture) && \
6+     if [ "$ARCH"  = "amd64"  ]; then \
7+         wget -O jre.zip https://github.com/supertokens/jre/raw/refs/heads/master/jre-15.0.1-linux.zip; \
8+     elif [ "$ARCH"  = "arm64"  ]; then \
9+         wget -O jre.zip https://github.com/supertokens/jre/raw/refs/heads/master/jre-15.0.1-linux-arm.zip; \
10+     else \
11+         echo "Unsupported architecture: $ARCH"  && exit 1; \
12+     fi
13+ RUN  unzip jre.zip
14+ RUN  mv jre-15.0.1 jre || mv jre-15.0.1-linux-aarch/jre-15.0.1 jre
15+ ADD  ./cli ./cli
16+ ADD  ./core ./core
17+ ADD  ./plugin-interface ./plugin-interface
18+ ADD  ./plugin ./plugin
19+ ADD  ./ee ./ee
20+ ADD  ./config.yaml ./config.yaml
21+ ADD  ./version.yaml ./version.yaml
22+ 
23+ RUN  ls && ./jre/bin/java -classpath "./cli/*"  io.supertokens.cli.Main true $@
24+ 
25+ FROM  debian:bookworm-slim
26+ RUN  groupadd supertokens && useradd -m -s /bin/bash -g supertokens supertokens
27+ RUN  apt-get update && apt-get install -y --no-install-recommends gnupg dirmngr curl && rm -rf /var/lib/apt/lists/*
28+ RUN  DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC apt-get -y install tzdata
29+ ENV  GOSU_VERSION=1.7
30+ RUN  set -x \
31+ 	&& apt-get update && apt-get install -y --no-install-recommends ca-certificates wget && rm -rf /var/lib/apt/lists/* \
32+ 	&& wget -O /usr/local/bin/gosu "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$(dpkg --print-architecture)"  \
33+ 	&& wget -O /usr/local/bin/gosu.asc "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$(dpkg --print-architecture).asc"  \
34+ 	&& export GNUPGHOME="$(mktemp -d)"  \
35+ 	&& gpg --batch --keyserver hkps://keys.openpgp.org --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4 \
36+ 	&& gpg --batch --verify /usr/local/bin/gosu.asc /usr/local/bin/gosu \
37+ 	&& gpgconf --kill all \
38+ 	&& rm -rf "$GNUPGHOME"  /usr/local/bin/gosu.asc \
39+ 	&& chmod +x /usr/local/bin/gosu \
40+ 	&& apt-get purge -y --auto-remove wget
41+ COPY  --from=tmp --chown=supertokens /usr/lib/supertokens /usr/lib/supertokens
42+ COPY  --from=tmp --chown=supertokens /usr/bin/supertokens /usr/bin/supertokens
43+ COPY  ./supertokens-postgresql-plugin/.github/helpers/docker/docker-entrypoint.sh /usr/local/bin/
44+ RUN  echo "$(md5sum /usr/lib/supertokens/config.yaml | awk '{ print $1 }')"  >> /CONFIG_HASH
45+ RUN  ln -s /usr/local/bin/docker-entrypoint.sh /entrypoint.sh # backwards compat
46+ RUN  chmod +x /usr/local/bin/docker-entrypoint.sh
47+ EXPOSE  3567
48+ USER  "supertokens" 
49+ ENTRYPOINT  ["/entrypoint.sh" ]
50+ CMD  ["supertokens" , "start" ]
0 commit comments