mirror of
https://github.com/unmojang/meta.git
synced 2025-09-24 03:31:03 -04:00
feat(docker): introduce variable UID/GID
This commit is contained in:
parent
e81830b790
commit
bab6bab12a
@ -1,4 +1,6 @@
|
|||||||
FROM python:3.10.2-bullseye
|
FROM python:3.10.2-bullseye
|
||||||
|
ARG UID=1337
|
||||||
|
ARG GID=1337
|
||||||
|
|
||||||
RUN pip install cachecontrol iso8601 requests lockfile jsonobject six \
|
RUN pip install cachecontrol iso8601 requests lockfile jsonobject six \
|
||||||
&& apt-get update && apt-get install -y rsync cron
|
&& apt-get update && apt-get install -y rsync cron
|
||||||
@ -12,10 +14,12 @@ RUN chmod 644 /etc/cron.d/meta-update \
|
|||||||
COPY docker/entrypoint.sh /usr/local/bin/entrypoint
|
COPY docker/entrypoint.sh /usr/local/bin/entrypoint
|
||||||
RUN chmod +x /usr/local/bin/entrypoint
|
RUN chmod +x /usr/local/bin/entrypoint
|
||||||
|
|
||||||
RUN useradd -Um user \
|
RUN groupadd -g $GID user \
|
||||||
|
&& useradd -m -g $GID -u $UID user \
|
||||||
&& mkdir -p /home/user/.ssh \
|
&& mkdir -p /home/user/.ssh \
|
||||||
&& ssh-keyscan github.com > /home/user/.ssh/known_hosts \
|
&& ssh-keyscan github.com > /home/user/.ssh/known_hosts \
|
||||||
&& mkdir -p /app
|
&& mkdir -p /app \
|
||||||
|
&& chown -R $UID:$GID /app /home/user/.ssh
|
||||||
|
|
||||||
COPY . /app/
|
COPY . /app/
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@ Scripts to generate jsons and jars that PolyMC will access.
|
|||||||
It is recommended to use Docker to deploy the environment.
|
It is recommended to use Docker to deploy the environment.
|
||||||
|
|
||||||
- Clone this repo to a server
|
- Clone this repo to a server
|
||||||
- Make sure it's writable by the container later: `chown -R 1000:1000 .`
|
- Make sure it's writable by the container later: `chown -R 1337:1337 .`
|
||||||
- Configure `config/config_local.sh`
|
- Configure `config/config_local.sh`
|
||||||
- The defaults should be fine (apart from committer email and name perhaps)
|
- The defaults should be fine (apart from committer email and name perhaps)
|
||||||
- Put your SSH key (which has push access to meta-upstream and meta-polymc) at `config/deploy.key`
|
- Put your SSH key (which has push access to meta-upstream and meta-polymc) at `config/deploy.key`
|
||||||
@ -16,6 +16,9 @@ It is recommended to use Docker to deploy the environment.
|
|||||||
- Observe Cron logs using `docker-compose logs -f` (Runs hourly by default)
|
- Observe Cron logs using `docker-compose logs -f` (Runs hourly by default)
|
||||||
- (Optional) Run once to fill caches: `docker-compose run meta update`
|
- (Optional) Run once to fill caches: `docker-compose run meta update`
|
||||||
|
|
||||||
|
For local development you can also use `docker-compose.local.yaml`. By default it uses `UID=1000` and `GID=1000`.
|
||||||
|
Make sure it's the same as your host instance.
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
### Install the dependencies
|
### Install the dependencies
|
||||||
|
16
docker-compose.local.yaml
Normal file
16
docker-compose.local.yaml
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
version: "3"
|
||||||
|
|
||||||
|
services:
|
||||||
|
meta:
|
||||||
|
build:
|
||||||
|
context: .
|
||||||
|
args:
|
||||||
|
UID: 1000
|
||||||
|
GID: 1000
|
||||||
|
command: update
|
||||||
|
volumes:
|
||||||
|
- "./caches:/app/caches"
|
||||||
|
- "./upstream:/app/upstream"
|
||||||
|
- "./polymc:/app/polymc"
|
||||||
|
- "./public:/app/public"
|
||||||
|
- "./config:/app/config"
|
Loading…
x
Reference in New Issue
Block a user