Skip to content

Commit

Permalink
Add Devcontainer config
Browse files Browse the repository at this point in the history
  • Loading branch information
kaikuchn committed Mar 18, 2024
1 parent d1fc933 commit 0139201
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 0 deletions.
13 changes: 13 additions & 0 deletions .devcontainer/bin/onCreateCommand
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash -ieu

# install rebar and hex, present in base image
install-mix-tooling

# prepare application
mix deps.get
mix assets.setup
mix ecto.setup
MIX_ENV=test mix ecto.setup

# import GitHub public key for git commit signature verification
curl https://github.com/web-flow.gpg | gpg --import
6 changes: 6 additions & 0 deletions .devcontainer/bin/updateContentCommand
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash -ieu

# compile application
mix deps.get
mix compile
MIX_ENV=test mix compile
24 changes: 24 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"name": "jehovakel_ex_times",
"dockerComposeFile": [
"docker-compose.yml"
],
"service": "devcontainer",
"workspaceFolder": "/workspace",
"remoteEnv": {
"HEROKU_API_KEY": "${localEnv:FINOPSTECH_BOT_HEROKU_CLI_TOKEN}"
},
"onCreateCommand": ".devcontainer/bin/onCreateCommand",
"updateContentCommand": ".devcontainer/bin/updateContentCommand",
"customizations": {
"codespaces": {
"repositories": {
"STUDITEMPS/devcontainer-base": {
"permissions": {
"packages": "read"
}
}
}
}
}
}
20 changes: 20 additions & 0 deletions .devcontainer/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
version: '3.8'
services:
# Update this to the name of the service you want to work with in your docker-compose.yml file
devcontainer:
image: ghcr.io/studitemps/devcontainer-base:date-2024-02-14

environment:
- DOPPLER_TOKEN

volumes:
# Update this to wherever you want VS Code to mount the folder of your project
- .:/workspace:cached
# Uncomment the next line to use Docker from inside the container. See https://aka.ms/vscode-remote/samples/docker-from-docker-compose for details.
# - /var/run/docker.sock:/var/run/docker.sock
# Store command history persistently
- commandhistory:/commandhistory
# Overrides default command so things don't shut down after the process ends.
command: sleep infinity
volumes:
commandhistory:

0 comments on commit 0139201

Please sign in to comment.