-
Notifications
You must be signed in to change notification settings - Fork 581
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Add dockerfile for deployment (#180)
This just adds a very simple dockerfile for deploying `coderd` (and later `provisionerd`). This adds a `deploy` directory at the root, and a `make docker/build` command to the makefile. Thanks @jawnsy for the all the help 😄
- Loading branch information
1 parent
4304d7d
commit b75ffdc
Showing
4 changed files
with
90 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
FROM registry.access.redhat.com/ubi8/ubi:latest | ||
|
||
COPY coderd /coder/coderd | ||
RUN chmod +x /coder/coderd | ||
|
||
COPY run.sh /coder/run.sh | ||
RUN chmod +x /coder/run.sh | ||
|
||
# Once `provisionerd` is available, we'll also need that binary | ||
# COPY bin/provisionerd /provisionerd | ||
# RUN chmod +x /provisionerd | ||
|
||
ENTRYPOINT ["/coder/run.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -euo pipefail | ||
|
||
EMAIL=${EMAIL:-admin@coder.com} | ||
USERNAME=${USERNAME:-admin} | ||
ORGANIZATION=${ORGANIZATION:-ACME-Corp} | ||
PASSWORD=${PASSWORD:-password} | ||
PORT=${PORT:-8000} | ||
|
||
# Helper to create an initial user | ||
function create_initial_user() { | ||
# TODO: We need to wait for `coderd` to spin up - | ||
# need to replace with a deterministic strategy | ||
sleep 5s | ||
|
||
curl -X POST \ | ||
-d '{"email": "'"$EMAIL"'", "username": "'"$USERNAME"'", "organization": "'"$ORGANIZATION"'", "password": "'"$PASSWORD"'"}' \ | ||
-H 'Content-Type:application/json' \ | ||
"http://localhost:$PORT/api/v2/user" | ||
} | ||
|
||
# This is a way to run multiple processes in parallel, and have Ctrl-C work correctly | ||
# to kill both at the same time. For more details, see: | ||
# https://stackoverflow.com/questions/3004811/how-do-you-run-multiple-programs-in-parallel-from-a-bash-script | ||
( | ||
trap 'kill 0' SIGINT | ||
create_initial_user & | ||
/coder/coderd --address=":$PORT" | ||
) |