Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 0 additions & 32 deletions .devcontainer/.devcontainer.json

This file was deleted.

70 changes: 37 additions & 33 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,42 +1,46 @@
# Use an official Elixir image as the base
FROM elixir:1.17-alpine
# Builder stage
FROM elixir:1.17-alpine AS builder

# Set default environment to development
ENV MIX_ENV=dev
ENV MIX_ENV=prod

# Install Hex, Rebar, and essential tools
RUN mix do local.hex --force, local.rebar --force \
&& apk add --no-cache \
git \
nodejs \
npm \
curl \
inotify-tools \
bash \
openssh \
postgresql-client

# Install GitHub CLI (gh)
RUN apk add --no-cache github-cli

# Ensure .ssh directory exists
RUN mkdir -p /root/.ssh && chmod 700 /root/.ssh

# Set up the application directory
WORKDIR /workspace

# Copy mix files and install dependencies
&& apk add --no-cache git curl bash openssh postgresql-client

WORKDIR /app

COPY mix.exs mix.lock ./
RUN mix deps.get --only $MIX_ENV
RUN mix deps.get

# Copy the rest of the application code
COPY . .
# Ensure directories exist
RUN mkdir -p /app/config /app/rel && mix compile

# Final stage
FROM elixir:1.17-alpine

ENV MIX_ENV=dev

RUN apk add --no-cache \
bash openssh postgresql-client \
git curl zsh zsh-autosuggestions zsh-syntax-highlighting zsh-completions \
&& curl -sfL git.io/antibody | sh -s - -b /usr/local/bin

WORKDIR /app

# Copy the entire project directory
COPY . /app

# Ensure proper permissions for the workspace directory
RUN chown -R root:root /workspace
# Default Powerlevel10k configuration
RUN echo "POWERLEVEL9K_MODE=nerdfont-complete" > /root/.p10k.zsh \
&& echo '[[ -f ~/.p10k.zsh ]] && source ~/.p10k.zsh' >> /root/.zshrc

# Run compilation in development mode
RUN mix compile
# Configure Zsh
RUN echo "export ZSH_THEME=\"robbyrussell\"" > /root/.zshrc \
&& echo "alias ll='ls -la'" >> /root/.zshrc \
&& echo "export SHELL=\"/bin/zsh\"" >> /root/.zshrc \
&& echo "source /root/.zsh_plugins.sh" >> /root/.zshrc \
&& antibody bundle zsh-users/zsh-autosuggestions > /root/.zsh_plugins.sh \
&& antibody bundle zsh-users/zsh-syntax-highlighting >> /root/.zsh_plugins.sh \
&& antibody bundle romkatv/powerlevel10k >> /root/.zsh_plugins.sh

# Default command for better interactive experience
CMD ["/bin/bash"]
CMD ["/bin/zsh"]
46 changes: 31 additions & 15 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,32 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/docker-existing-dockerfile
{
"name": "Existing Dockerfile",
"image": "ghcr.io/elixir-journey/elixir-kickoff:latest"
// Features to add to the dev container. More info: https://containers.dev/features.
// "features": {},
// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],
// Uncomment the next line to run commands after the container is created.
// "postCreateCommand": "cat /etc/os-release",
// Configure tool-specific properties.
// "customizations": {},
// Uncomment to connect as an existing user other than the container default. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "devcontainer"
}
"name": "Elixir Kickoff Development Container",
"image": "ghcr.io/elixir-journey/elixir-kickoff:latest",
"remoteEnv": {
"MIX_ENV": "dev"
},
"customizations": {
"vscode": {
"extensions": [
"jakebecker.elixir-ls",
"ms-azuretools.vscode-docker",
"editorconfig.editorconfig",
"eamodio.gitlens",
"streetsidesoftware.code-spell-checker",
"esbenp.prettier-vscode",
"pkief.material-icon-theme"
],
"settings": {
"terminal.integrated.shell.linux": "/bin/bash"
}
}
},
"postCreateCommand": "mix deps.get",
"postStartCommand": "/bin/sh /workspace/.devcontainer/scripts/post_start.sh",
"mounts": [
"source=${localWorkspaceFolder},target=/workspace,type=bind",
"source=${localEnv:HOME}/.gitconfig,target=/root/.gitconfig,type=bind,consistency=cached",
"source=${localEnv:HOME}/.ssh,target=/root/.ssh,type=bind,consistency=cached",
"source=${localEnv:HOME}/.p10k.zsh,target=/root/.p10k.zsh,type=bind,consistency=cached"
],
"workspaceFolder": "/workspace"
}
File renamed without changes.
15 changes: 15 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Elixir build files
/_build
/deps

# Node.js build files (if applicable)
node_modules

# Editor and OS files
*.swp
*.swo
*.log
.DS_Store

# Git ignored files
.git
Loading