Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated devcontainer to use production container #4039

Merged
merged 11 commits into from
Oct 23, 2024
Merged
Show file tree
Hide file tree
Changes from 6 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
42 changes: 40 additions & 2 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,15 @@
// Sets the run context to one level up instead of the .devcontainer folder.
"context": "..",
// Update the 'dockerFile' property if you aren't using the standard 'Dockerfile' filename.
"dockerFile": "../Dockerfile.vscode",
"dockerFile": "../Dockerfile",
// make sure you don't have any local .venv in wps/api or it won't work
// note: we don't use a workspace mount because then you'll only see the files in /api, when
// you probably want to see everything. This means you must cd from /workspace to /app in order
// to actually run things though. the following mount will at least make the /app folder in the
// docker container change when files in api change.
"mounts": [
"source=${localWorkspaceFolder}/api,target=/app,type=bind"
],
// 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 - for example installing curl.
Expand All @@ -15,5 +23,35 @@
// Uncomment to use the Docker CLI from inside the container. See https://aka.ms/vscode-remote/samples/docker-from-docker.
// "mounts": [ "source=/var/run/docker.sock,target=/var/run/docker.sock,type=bind" ],
// Uncomment to connect as a non-root user if you've added one. See https://aka.ms/vscode-remote/containers/non-root.
"remoteUser": "vscode"
"remoteUser": "worker",
"containerUser": "worker",
"updateRemoteUserUID": false, // without this you wind up as ubuntu user
// this lets the container access the database container. On linux I had to configure the db
// host to localhost for it to work in the .env file in api/app
// tested with the database running from the docker-compose file with `docker compose up db`
"forwardPorts": [
8080
],
"runArgs": [
"--network=host",
"--platform",
"linux/amd64",
"--hostname=wps-dev",
],
"postCreateCommand": "echo 'cd /app' >> ~/.bashrc",
// by default the dockerfile sets the shell to /bin/sh - you can use whatever you like here
// but if you use bash, it will automatically set you in the /app folder rather than workspace
// when the terminal connects
"customizations": {
"vscode": {
"settings": {
"terminal.integrated.defaultProfile.linux": "bash",
"terminal.integrated.profiles.linux": {
"bash": {
"path": "/bin/bash"
}
}
}
}
}
}
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG DOCKER_IMAGE=image-registry.openshift-image-registry.svc:5000/e1e498-tools/wps-api-base:02-10-2024
ARG DOCKER_IMAGE=ghcr.io/bcgov/wps/wps-api-base:10-21-2024
# To build locally, point to a local base image you've already built (see openshift/wps-api-base)
# e.g. : docker build --build-arg DOCKER_IMAGE=wps-api-base:my-tag .

Expand Down
88 changes: 0 additions & 88 deletions Dockerfile.vscode

This file was deleted.

Loading