diff options
Diffstat (limited to '.devcontainer')
| -rw-r--r-- | .devcontainer/Dockerfile | 10 | ||||
| -rw-r--r-- | .devcontainer/devcontainer.json | 50 | ||||
| -rw-r--r-- | .devcontainer/docker-compose.yml | 48 |
3 files changed, 39 insertions, 69 deletions
diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 58ca2cb..a1aa4f0 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -1,4 +1,4 @@ -# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.209.6/containers/java/.devcontainer/base.Dockerfile +# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.241.1/containers/java/.devcontainer/base.Dockerfile # [Choice] Java version (use -bullseye variants on local arm64/Apple Silicon): 11, 17, 11-bullseye, 17-bullseye, 11-buster, 17-buster ARG VARIANT="17-bullseye" @@ -17,6 +17,14 @@ RUN if [ "${INSTALL_MAVEN}" = "true" ]; then su vscode -c "umask 0002 && . /usr/ ARG NODE_VERSION="none" RUN if [ "${NODE_VERSION}" != "none" ]; then su vscode -c "umask 0002 && . /usr/local/share/nvm/nvm.sh && nvm install ${NODE_VERSION} 2>&1"; fi +# Liquibase CLI +ARG LIQUIBASE_VERSION="4.14.0" +RUN mkdir -p /opt/liquibase && cd /opt/liquibase \ + && curl -GL https://github.com/liquibase/liquibase/releases/download/v${LIQUIBASE_VERSION}/liquibase-${LIQUIBASE_VERSION}.tar.gz -o ./liquibase.tar.gz \ + && tar xvf ./liquibase.tar.gz \ + && rm liquibase.tar.gz +ENV PATH $PATH:/opt/liquibase + # [Optional] Uncomment this section to install additional OS packages. # RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ # && apt-get -y install --no-install-recommends <your-package-list-here> diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index cb0c829..e4580f7 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,34 +1,44 @@ // For format details, see https://aka.ms/devcontainer.json. For config options, see the README at: -// https://github.com/microsoft/vscode-dev-containers/tree/v0.209.6/containers/java +// https://github.com/microsoft/vscode-dev-containers/tree/v0.241.1/containers/java { "name": "Pantry", - "dockerComposeFile": "docker-compose.yml", - "service": "pantry", - "workspaceFolder": "/workspaces/pantry", - - // Set *default* container specific settings.json values on container create. - "settings": { - "java.jdt.ls.java.home": "/docker-java-home" + "build": { + "dockerfile": "Dockerfile", + "args": { + "VARIANT": "17-bullseye", + "INSTALL_MAVEN": "true", + "INSTALL_GRADLE": "false", + "NODE_VERSION": "lts/*", + "LIQUIBASE_VERSION": "4.14.0" + } }, - - // Add the IDs of extensions you want installed when the container is created. - "extensions": [ - "vscjava.vscode-java-pack", - "gabrielbb.vscode-lombok", - "redhat.vscode-yaml", - "visualstudioexptteam.vscodeintellicode", - "redhat.fabric8-analytics", + + "mounts": [ + // Pass through Maven settings and repository cache + "source=${localEnv:HOME}/.m2,target=/home/vscode/.m2,type=bind,consistency=cached" ], - // Use 'forwardPorts' to make a list of ports inside the container available locally. - // "forwardPorts": [], + "customizations": { + "vscode": { + "settings": { + }, + + "extensions": [ + "vscjava.vscode-java-pack", + "redhat.vscode-yaml", + "visualstudioexptteam.vscodeintellicode", + "redhat.fabric8-analytics", + "redhat.vscode-quarkus" + ] + } + }, // Use 'postCreateCommand' to run commands after the container is created. - "postCreateCommand": "mvn compile spring-boot:run", + // "postCreateCommand": "mvn compile", // Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root. "remoteUser": "vscode", "features": { - "kubectl-helm-minikube": "1.22" + "docker-from-docker": "latest" } } diff --git a/.devcontainer/docker-compose.yml b/.devcontainer/docker-compose.yml deleted file mode 100644 index 447dadc..0000000 --- a/.devcontainer/docker-compose.yml +++ /dev/null @@ -1,48 +0,0 @@ -version: '3' - -services: - pantry: - build: - context: . - dockerfile: Dockerfile - args: - # Volume directory for hosted files. This directory is created on image build with proper permissions. This is set as an env-var in the Dockerfile - VARIANT: "11" - - # Options - INSTALL_MAVEN: "true" - INSTALL_GRADLE: "false" - NODE_VERSION: "lts/*" - - environment: - MARIADB_HOST: "pantry-db" - - volumes: - - ..:/workspaces/pantry:cached - - # Overrides default command so things don't shut down after the process ends. - command: sleep infinity - - # Runs app on the same network as the database container, allows "forwardPorts" in devcontainer.json function. - network_mode: service:pantry-db - - # Use "forwardPorts" in **devcontainer.json** to forward an app port locally. - # (Adding the "ports" property to this file will not forward from a Codespace.) - - pantry-db: - image: mariadb:10.7 - restart: unless-stopped - volumes: - - pantrydb-data:/var/lib/mysql - - environment: - MARIADB_RANDOM_ROOT_PASSWORD: "true" - MARIADB_DATABASE: "pantry-db" - MARIADB_USER: "pantry-user" - MARIADB_PASSWORD: "i2j9ds0g" - - # Add "forwardPorts": ["27017"] to **devcontainer.json** to forward MongoDB locally. - # (Adding the "ports" property to this file will not forward from a Codespace.) - -volumes: - pantrydb-data:
\ No newline at end of file |
