add dev environment
All checks were successful
All checks were successful
This commit is contained in:
0
.devcontainer/.gitignore
vendored
Normal file
0
.devcontainer/.gitignore
vendored
Normal file
7
.devcontainer/Dockerfile
Normal file
7
.devcontainer/Dockerfile
Normal file
@@ -0,0 +1,7 @@
|
||||
FROM mcr.microsoft.com/devcontainers/rust:1-1-bookworm
|
||||
|
||||
# Include lld linker to improve build times either by using environment variable
|
||||
# RUSTFLAGS="-C link-arg=-fuse-ld=lld" or with Cargo's configuration file (i.e see .cargo/config.toml).
|
||||
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
|
||||
&& apt-get -y install clang lld npm \
|
||||
&& apt-get autoremove -y && apt-get clean -y
|
||||
35
.devcontainer/devcontainer.json
Normal file
35
.devcontainer/devcontainer.json
Normal file
@@ -0,0 +1,35 @@
|
||||
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
|
||||
// README at: https://github.com/devcontainers/templates/tree/main/src/rust-postgres
|
||||
{
|
||||
"name": "Rust and PostgreSQL",
|
||||
// "dockerComposeFile": ["../../docker-compose.dev.yaml", "docker-compose.yml"],
|
||||
"dockerComposeFile": "docker-compose.yml",
|
||||
"service": "rust-services",
|
||||
"workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}",
|
||||
|
||||
// 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": [5432],
|
||||
|
||||
// Use 'postCreateCommand' to run commands after the container is created.
|
||||
// "postCreateCommand": ".devcontainer/post-create.sh",
|
||||
"customizations": {
|
||||
"vscode": {
|
||||
"extensions": [
|
||||
"rangav.vscode-thunder-client",
|
||||
"redhat.vscode-xml"
|
||||
]
|
||||
}
|
||||
},
|
||||
"features": {
|
||||
"ghcr.io/jayree/devcontainer-features/npm-registry:1": {}
|
||||
}
|
||||
|
||||
// Configure tool-specific properties.
|
||||
// "customizations": {},
|
||||
|
||||
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
|
||||
// "remoteUser": "root"
|
||||
}
|
||||
48
.devcontainer/docker-compose.yml
Normal file
48
.devcontainer/docker-compose.yml
Normal file
@@ -0,0 +1,48 @@
|
||||
volumes:
|
||||
postgres-data:
|
||||
|
||||
services:
|
||||
rust-services:
|
||||
# build:
|
||||
# context: ./services
|
||||
# dockerfile: .devcontainer/Dockerfile
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
# env_file:
|
||||
# # Ensure that the variables in .env match the same variables in devcontainer.json
|
||||
# - .env
|
||||
|
||||
volumes:
|
||||
- ../..:/workspaces:cached
|
||||
|
||||
ports:
|
||||
- 3000:3000
|
||||
- 8080:8080
|
||||
|
||||
# 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: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.)
|
||||
|
||||
db:
|
||||
image: postgres:17
|
||||
restart: unless-stopped
|
||||
volumes:
|
||||
- postgres-data:/var/lib/postgresql/data
|
||||
- ./tmp:/tmp
|
||||
|
||||
environment:
|
||||
POSTGRES_USER: postgres
|
||||
POSTGRES_PASSWORD: postgres
|
||||
POSTGRES_DB: mediamanager
|
||||
# env_file:
|
||||
# # Ensure that the variables in .env match the same variables in devcontainer.json
|
||||
# - .env
|
||||
|
||||
# Add "forwardPorts": ["5432"] to **devcontainer.json** to forward PostgreSQL locally.
|
||||
# (Adding the "ports" property to this file will not forward from a Codespace.)
|
||||
1
.devcontainer/post-create.sh
Executable file
1
.devcontainer/post-create.sh
Executable file
@@ -0,0 +1 @@
|
||||
cargo install cargo-watch
|
||||
3
.gitignore
vendored
3
.gitignore
vendored
@@ -3,6 +3,7 @@
|
||||
!.gitignore
|
||||
!.gitea
|
||||
!.cargo
|
||||
!.devcontainer
|
||||
|
||||
# -- Rust
|
||||
# For .cargo/config.toml
|
||||
@@ -38,4 +39,4 @@ report.*.json
|
||||
*.jpeg
|
||||
*.jpg
|
||||
*.gif
|
||||
*.png
|
||||
*.png
|
||||
|
||||
Reference in New Issue
Block a user