mirror of
https://github.com/rommapp/romm.git
synced 2026-03-03 03:57:01 +00:00
Add Dockerfile and entrypoint script for development environment setup
- Create .devcontainer/Dockerfile for frontend and Python dependencies - Create .devcontainer/Dockerfile.base for system dependencies - Add entrypoint script to manage service startup and symlink creation - Update docker-compose.yml to reference the new Dockerfile - Modify DEVELOPER_SETUP.md for updated installation instructions
This commit is contained in:
19
.devcontainer/Dockerfile
Normal file
19
.devcontainer/Dockerfile
Normal file
@@ -0,0 +1,19 @@
|
||||
# trunk-ignore-all(trivy)
|
||||
# trunk-ignore-all(checkov)
|
||||
|
||||
FROM rommapp/romm-devcontainer:4.1.4
|
||||
|
||||
# Install frontend dependencies
|
||||
COPY frontend/package.json /app/frontend/
|
||||
WORKDIR /app/frontend
|
||||
RUN npm install
|
||||
|
||||
# Set working directory
|
||||
WORKDIR /app
|
||||
|
||||
# Copy project files (including pyproject.toml and uv.lock)
|
||||
COPY pyproject.toml uv.lock* .python-version /app/
|
||||
|
||||
# Install Python dependencies
|
||||
RUN uv sync --all-extras
|
||||
ENV PATH="/app/.venv/bin:${PATH}"
|
||||
@@ -1,7 +1,7 @@
|
||||
# trunk-ignore-all(trivy)
|
||||
# trunk-ignore-all(checkov)
|
||||
|
||||
FROM ubuntu:22.04
|
||||
FROM ubuntu:24.04
|
||||
|
||||
# Prevent interactive prompts during installation
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
@@ -54,30 +54,14 @@ RUN sed -i '22a #include <ctime>' ./src/Util.h \
|
||||
&& cp ./bin64/RAHasher /usr/bin/RAHasher
|
||||
RUN rm -rf /tmp/RALibretro
|
||||
|
||||
# Install frontend dependencies
|
||||
COPY frontend/package.json /app/frontend/
|
||||
WORKDIR /app/frontend
|
||||
RUN npm install
|
||||
|
||||
# Set working directory
|
||||
WORKDIR /app
|
||||
|
||||
# Install uv for the non-root user
|
||||
COPY --from=ghcr.io/astral-sh/uv:0.7.19 /uv /uvx /usr/local/bin/
|
||||
|
||||
# Install Python
|
||||
RUN uv python install 3.13
|
||||
|
||||
# Copy project files (including pyproject.toml and uv.lock)
|
||||
COPY pyproject.toml uv.lock* .python-version /app/
|
||||
|
||||
# Install Python dependencies
|
||||
RUN uv sync --all-extras
|
||||
|
||||
ENV PATH="/app/.venv/bin:${PATH}"
|
||||
|
||||
# Copy entrypoint script
|
||||
COPY entrypoint.sh /entrypoint.sh
|
||||
COPY .devcontainer/entrypoint.sh /entrypoint.sh
|
||||
RUN chmod +x /entrypoint.sh
|
||||
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
@@ -70,7 +70,7 @@ cp env.template .env
|
||||
|
||||
```sh
|
||||
# https://mariadb.com/docs/skysql-previous-release/connect/programming-languages/c/install/#Installation_via_Package_Repository_(Linux):
|
||||
sudo apt install libmariadb3 libmariadb-dev libpq-dev
|
||||
sudo apt update && sudo apt install libmariadb3 libmariadb-dev libpq-dev build-essential make -y
|
||||
|
||||
# Build and configure RAHasher (optional)
|
||||
# This is only required to calculate RA hashes
|
||||
@@ -81,7 +81,7 @@ git checkout 1.8.0
|
||||
git submodule update --init --recursive
|
||||
sed -i '22a #include <ctime>' ./src/Util.h
|
||||
make HAVE_CHD=1 -f ./Makefile.RAHasher
|
||||
cp ./bin64/RAHasher /usr/bin/RAHasher
|
||||
sudo cp ./bin64/RAHasher /usr/bin/RAHasher
|
||||
```
|
||||
|
||||
#### - Install python dependencies
|
||||
@@ -96,11 +96,11 @@ curl -LsSf https://astral.sh/uv/install.sh | sh
|
||||
|
||||
Then create the virtual environment and install the dependencies using uv:
|
||||
|
||||
````sh
|
||||
```sh
|
||||
uv venv
|
||||
source .venv/bin/activate
|
||||
uv sync --all-extras --dev
|
||||
``
|
||||
```
|
||||
|
||||
#### - Spin up the database and other services
|
||||
|
||||
@@ -180,4 +180,7 @@ uv run pytest [path/file]
|
||||
# the -vv switch increases the verbosity of the output, providing more detailed information during test execution.
|
||||
uv run pytest -vv
|
||||
```
|
||||
````
|
||||
|
||||
```
|
||||
|
||||
```
|
||||
|
||||
@@ -4,7 +4,7 @@ services:
|
||||
romm-dev:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
dockerfile: .devcontainer/Dockerfile
|
||||
container_name: romm-dev
|
||||
env_file: .env
|
||||
environment:
|
||||
|
||||
Reference in New Issue
Block a user