Skip to content

Commit

Permalink
devcontainer added
Browse files Browse the repository at this point in the history
  • Loading branch information
stan-dot committed Oct 8, 2024
1 parent 1e3c29f commit 7dd0fa6
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 2 deletions.
42 changes: 42 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
// For format details, see https://containers.dev/implementors/json_reference/
{
"name": "Java Developer Container",
"build": {
"dockerfile": "../Dockerfile",
"target": "developer"
},
"remoteEnv": {
// Allow X11 apps to run inside the container
"DISPLAY": "${localEnv:DISPLAY}"
},
"customizations": {
"vscode": {
// Set *default* container specific settings.json values on container create.
"settings": {},
// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"ms-python.python",
"vscjava.vscode-java-pack",
"vmware.vscode-boot-dev-pack",
"github.vscode-github-actions",
"redhat.vscode-yaml",
"ms-azuretools.vscode-docker"
]
}
},
"features": {
// Some default things like git config
"ghcr.io/devcontainers/features/common-utils:2": {
"upgradePackages": false
}
},
"runArgs": [
// Allow the container to access the host X11 display and EPICS CA
"--net=host",
// Make sure SELinux does not disable with access to host filesystems like tmp
"--security-opt=label=disable"
],
// Mount the parent as /workspaces so we can pip install peers as editable
"workspaceMount": "source=${localWorkspaceFolder}/..,target=/workspaces,type=bind",
// After the container is created, install the python project in editable form
}
25 changes: 23 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,27 @@
FROM eclipse-temurin:17-jre
# Stage 1: Development stage
FROM eclipse-temurin:17-jdk AS developer

# deployment unit
# Install any development tools you need, for example, Maven, Git, etc.
RUN apt-get update && \
apt-get install -y maven git && \
apt-get clean

# Set the working directory for development
WORKDIR /workspace

# Optionally, you can clone or copy the source code if needed (e.g., for devcontainers)
# If using a local dev environment, you might mount your code with volumes instead.
# Example:
# COPY . /workspace

# Open a shell for interactive development
CMD ["/bin/bash"]

# Stage 2: Production deployment stage
FROM eclipse-temurin:17-jre AS production

# Copy the JAR from the build context
COPY target/ChannelFinder-*.jar /channelfinder/ChannelFinder-*.jar

# Set the CMD to run the application in production mode
CMD ["java", "-jar", "/channelfinder/ChannelFinder-*.jar", "--spring.config.name=application"]

0 comments on commit 7dd0fa6

Please sign in to comment.