Docker run only

Hi, I want to host Keycloak on Railway. To do that I only have to run the following docker run command:
docker run -p 8080:8080 -e KEYCLOAK_ADMIN=admin -e KEYCLOAK_ADMIN_PASSWORD=admin quay.io/keycloak/keycloak:20.0.2 start-dev
docker run -p 8080:8080 -e KEYCLOAK_ADMIN=admin -e KEYCLOAK_ADMIN_PASSWORD=admin quay.io/keycloak/keycloak:20.0.2 start-dev
Any tips how to run this command and where?
8 Replies
Percy
Percy2y ago
Project ID: N/A
youridb
youridbOP2y ago
N/A
jackson
jackson2y ago
uhhhhhhhhh could try making a github repo with just a dockerfile that looked something like this
FROM quay.io/keycloak/keycloak:20.0.2

ENV KEYCLOAK_ADMIN=admin
ENV KEYCLOAK_ADMIN_PASSWORD=admin

EXPOSE 8080
CMD ["start-dev"]
FROM quay.io/keycloak/keycloak:20.0.2

ENV KEYCLOAK_ADMIN=admin
ENV KEYCLOAK_ADMIN_PASSWORD=admin

EXPOSE 8080
CMD ["start-dev"]
not 100% sure if that would work but worth a shot
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Adam
Adam2y ago
If you’d like, go for it
youridb
youridbOP2y ago
I used the following Dockerfile:
FROM quay.io/keycloak/keycloak:latest as builder

ARG DB_URL
ARG DB_USERNAME
ARG DB_PASSWORD
ARG HOSTNAME
# Railway should automatically specify this port
ARG PORT

ENV KC_HEALTH_ENABLED=true
ENV KC_METRICS_ENABLED=true
ENV KC_FEATURES=token-exchange
ENV KC_DB=postgres

RUN /opt/keycloak/bin/kc.sh build --db=postgres

ENV KEYCLOAK_ADMIN=admin
ENV KEYCLOAK_ADMIN_PASSWORD=admin

ENV KC_HTTP_PORT=${PORT}
ENV KC_HTTP_HOST=0.0.0.0
ENV KC_PROXY=edge

ENV KC_DB_URL=${DB_URL}
ENV KC_DB_USERNAME=${DB_USERNAME}
ENV KC_DB_PASSWORD=${DB_PASSWORD}
ENV KC_HOSTNAME=${HOSTNAME}
FROM quay.io/keycloak/keycloak:latest as builder

ARG DB_URL
ARG DB_USERNAME
ARG DB_PASSWORD
ARG HOSTNAME
# Railway should automatically specify this port
ARG PORT

ENV KC_HEALTH_ENABLED=true
ENV KC_METRICS_ENABLED=true
ENV KC_FEATURES=token-exchange
ENV KC_DB=postgres

RUN /opt/keycloak/bin/kc.sh build --db=postgres

ENV KEYCLOAK_ADMIN=admin
ENV KEYCLOAK_ADMIN_PASSWORD=admin

ENV KC_HTTP_PORT=${PORT}
ENV KC_HTTP_HOST=0.0.0.0
ENV KC_PROXY=edge

ENV KC_DB_URL=${DB_URL}
ENV KC_DB_USERNAME=${DB_USERNAME}
ENV KC_DB_PASSWORD=${DB_PASSWORD}
ENV KC_HOSTNAME=${HOSTNAME}
I'm really interested in what your solution was without a database. Would you mind sharing it? Or at least the Thread you explained it in?
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Want results from more Discord servers?
Add your server