├── .dockerignore ├── Dockerfile ├── LICENSE ├── README.md └── config.yaml /.dockerignore: -------------------------------------------------------------------------------- 1 | .git -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM node:alpine 2 | 3 | MAINTAINER David Wisner 4 | 5 | RUN apk update && apk upgrade && apk add git && adduser -D -S -s /bin/sh -h /sinopia sinopia 6 | 7 | USER sinopia 8 | 9 | RUN git clone --depth 1 https://github.com/rnbwd/sinopia /sinopia/registry 10 | 11 | ADD config.yaml /sinopia/registry/config.yaml 12 | 13 | WORKDIR /sinopia/registry 14 | 15 | RUN npm install --production 16 | 17 | VOLUME /sinopia/storage 18 | EXPOSE 4873 19 | CMD ["./bin/sinopia"] 20 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 David Harris 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## Sinopia (Docker Image) 2 | 3 | > [Sinopia](https://github.com/rlidwka/sinopia) is a private npm repository server. 4 | 5 | ----------- 6 | 7 | > `docker pull rnbwd/sinopia` 8 | 9 | - The current latest (this will change soon) is based on my slighly modified version for use with `jwilder/nginx-proxy` (default build for the last 2 years) `rnbwd/sinopia:proxy` (`latest`). 10 | 11 | - For those who want to use the orignal, [unmodified repo](https://github.com/rlidwka/sinopia) and [node v0.10](https://nodejs.org/docs/latest-v0.10.x/api/), use `rnbwd/sinopia:stable`. 12 | 13 | - Also there's an alpine version that's very tiny and efficient, currently experimental `rnbwd/sinopia:alpine`. 14 | 15 | - The file structure has been modified - the sinopia repo is located at /sinopia/registry. See [this issue](https://github.com/rlidwka/sinopia/issues/376) for speculation on the future of sinopia. 16 | 17 | 18 | 19 | ### Recommend Usage 20 | 21 | - To run default container on port 4873 22 | 23 | `docker run --name sinopia -d -p 4873:4873 rnbwd/sinopia` 24 | 25 | `docker run --name sinopia -d -p 4873:4873 -v :/sinopia/registry/storage -v :/sinopia/registry/config.yaml rnbwd/sinopia` 26 | 27 | - The volume will be synced, so you can update the anything linked outside of the container and it will automatically change the files inside the container. Run `docker restart sinopia` if `config.yaml` is updated. 28 | wd/sinopia` 29 | 30 | ### Building Custom Containers 31 | 32 | - From github repository 33 | 34 | ``` 35 | git clone https://github.com/RnbWd/sinopia-docker.git 36 | cd sinopia-docker 37 | docker build -t sinopia . 38 | docker run -d -p 4873:4873 sinopia 39 | ``` 40 | 41 | ## License 42 | 43 | MIT 44 | -------------------------------------------------------------------------------- /config.yaml: -------------------------------------------------------------------------------- 1 | # path to a directory with all packages 2 | storage: ./storage/cache 3 | 4 | web: 5 | # enable: true 6 | 7 | title: Sinopia 8 | # logo: logo.png 9 | # template: custom.hbs 10 | 11 | auth: 12 | htpasswd: 13 | file: ./storage/htpasswd 14 | # Maximum amount of users allowed to register, defaults to "+inf". 15 | # You can set this to -1 to disable registration. 16 | #max_users: 1000 17 | 18 | # a list of other known repositories we can talk to 19 | uplinks: 20 | npmjs: 21 | url: https://registry.npmjs.org/ 22 | 23 | # amount of time to wait for repository to respond 24 | # before giving up and use the local cached copy 25 | #timeout: 30s 26 | 27 | # maximum time in which data is considered up to date 28 | # 29 | # default is 2 minutes, so server won't request the same data from 30 | # uplink if a similar request was made less than 2 minutes ago 31 | #maxage: 2m 32 | 33 | # if two subsequent requests fail, no further requests will be sent to 34 | # this uplink for five minutes 35 | #max_fails: 2 36 | #fail_timeout: 5m 37 | 38 | # timeouts are defined in the same way as nginx, see: 39 | # http://wiki.nginx.org/ConfigNotation 40 | 41 | packages: 42 | 43 | # uncomment this for packages with "local-" prefix to be available 44 | # for admin only, it's a recommended way of handling private packages 45 | #'local-*': 46 | # allow_access: admin 47 | # allow_publish: admin 48 | # # you can override storage directory for a group of packages this way: 49 | # storage: 'local_storage' 50 | 51 | '@*/*': 52 | # scoped packages 53 | allow_access: $all 54 | allow_publish: $authenticated 55 | 56 | '*': 57 | # allow all users (including non-authenticated users) to read and 58 | # publish all packages 59 | # 60 | # you can specify usernames/groupnames (depending on your auth plugin) 61 | # and three keywords: "$all", "$anonymous", "$authenticated" 62 | allow_access: $all 63 | 64 | # allow all known users to publish packages 65 | # (anyone can register by default, remember?) 66 | allow_publish: $authenticated 67 | 68 | # if package is not available locally, proxy requests to 'npmjs' registry 69 | proxy: npmjs 70 | 71 | 72 | ##################################################################### 73 | # Advanced settings 74 | ##################################################################### 75 | 76 | # if you use nginx with custom path, use this to override links 77 | #url_prefix: https://foo.com 78 | 79 | # you can specify listen address (or simply a port) 80 | listen: 0.0.0.0:4873 81 | 82 | # type: file | stdout | stderr 83 | # level: trace | debug | info | http (default) | warn | error | fatal 84 | # 85 | # parameters for file: name is filename 86 | # {type: 'file', path: 'sinopia.log', level: 'debug'}, 87 | # 88 | # parameters for stdout and stderr: format: json | pretty 89 | # {type: 'stdout', format: 'pretty', level: 'debug'}, 90 | logs: 91 | - {type: stdout, format: pretty, level: http} 92 | #- {type: file, path: sinopia.log, level: info} 93 | 94 | # you can specify proxy used with all requests in wget-like manner here 95 | # (or set up ENV variables with the same name) 96 | #http_proxy: http://something.local/ 97 | #https_proxy: https://something.local/ 98 | #no_proxy: localhost,127.0.0.1 99 | 100 | # maximum size of uploaded json document 101 | # increase it if you have "request entity too large" errors 102 | # max_body_size: 500mb 103 | 104 | # Workaround for countless npm bugs. Must have for npm <1.14.x, but expect 105 | # it to be turned off in future versions. If `true`, latest tag is ignored, 106 | # and the highest semver is placed instead. 107 | --------------------------------------------------------------------------------