diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..3cbc7a3 --- /dev/null +++ b/.env.example @@ -0,0 +1,14 @@ +# optional, used for fetching build logs, not configured automatically +RAILWAY_TOKEN=your_railway_token_here + +# optional but automatically configured by Railway +# RAILWAY_PROJECT_ID=your_project_id_here +# RAILWAY_SERVICE_ID=your_service_id_here +# RAILWAY_ENVIRONMENT_ID=your_environment_id_here +# RAILWAY_DEPLOYMENT_ID=your_deployment_id_here + +# optional, automatically configured by Railway +# PORT=5800 + +# optional, has a default you may not want +# RAILWAY_PUBLIC_DOMAIN=your-domain.railway.app diff --git a/Dockerfile b/Dockerfile index 51f59eb..9e4e52e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -51,5 +51,10 @@ COPY --from=builder-demo /build/demo/target/x86_64-pc-windows-gnu/release/demo.e COPY --from=builder-demo /build/demo/target/x86_64-unknown-linux-gnu/release/demo ./demo-linux COPY --from=builder-server /build/server/target/release/dynamic-preauth ./dynamic-preauth -EXPOSE 5800 +# Build-time arg for PORT, default to 5800 +ARG PORT=5800 +# Runtime environment var for PORT, default to build-time arg +ENV PORT=${PORT} +EXPOSE ${PORT} + CMD ["/app/dynamic-preauth"] \ No newline at end of file