Skip to content

Commit

Permalink
ssh-config
Browse files Browse the repository at this point in the history
  • Loading branch information
rebkwok committed Jan 3, 2024
1 parent e855a89 commit c116bf0
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
7 changes: 5 additions & 2 deletions DEPLOY.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,9 @@ dokku$ chown dokku:dokku /var/lib/dokku/data/storage/bennettbot
dokku$ dokku storage:mount bennettbot /var/lib/dokku/data/storage/bennettbot/:/storage
```

### SSH keys
Ensure that a valid ssh key exists at `/var/lib/dokku/data/storage/bennettbot/.ssh/id_ed25519`. This will be mounted into the dokku app and used for any jobs that run `fab` commands.

### Configure app environment variables

See also comments in `ebmbot/settings.py`.
Expand Down Expand Up @@ -119,10 +122,10 @@ service account:

The path for logs; set this to a directory in the dokku mounted storage so the logs
persist outside of the containers.
- LOGS_DIR
- `LOGS_DIR`

The path for the sqlite db file; set this to a file in the dokku mounted storage
- DB_PATH
- `DB_PATH`

Set each env varible with:
```sh
Expand Down
12 changes: 11 additions & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,17 @@ LABEL org.opencontainers.image.title="bennettbot" \
# copy application code
COPY . /app

# Put ssh config in expected place
RUN mkdir /.ssh
COPY docker/ssh_config /.ssh/config

# We set command rather than entrypoint, to make it easier to run different
# things from the cli
# In production, dokku extract the Procfile and uses the commands defined
# there as the entrypoints. If we defined an ENTRYPOINT here, the commands
# in the Procfile would be passed as arguments to that ENTRYPOINT, which is
# not what we want
# https://dokku.com/docs/processes/process-management/#procfile
CMD ["/app/docker/entrypoints/prod.sh"]

# finally, tag with build information. These will change regularly, therefore
Expand All @@ -124,7 +132,9 @@ LABEL org.opencontainers.image.revision=$GITREF
ARG USERID=10004
ARG GROUPID=10004

RUN mkdir /.ssh
# Jobs that run fab commands add fabfiles into the job's workspace, so need
# to own this folder
RUN chown -R ${USERID}:${GROUPID} /app/workspace

USER ${USERID}:${GROUPID}

Expand Down

0 comments on commit c116bf0

Please sign in to comment.