This commit is contained in:
		
							
								
								
									
										26
									
								
								.drone.yml
									
									
									
									
									
								
							
							
						
						
									
										26
									
								
								.drone.yml
									
									
									
									
									
								
							| @@ -2,13 +2,19 @@ kind: pipeline | |||||||
| type: docker | type: docker | ||||||
| name: cannery | name: cannery | ||||||
|  |  | ||||||
| cache: | steps: | ||||||
|  | - name: restore-cache | ||||||
|  |   image: drillster/drone-volume-cache | ||||||
|  |   volumes: | ||||||
|  |   - name: cache | ||||||
|  |     path: /cache | ||||||
|  |   settings: | ||||||
|  |     restore: true | ||||||
|     mount: |     mount: | ||||||
|       - _build |       - _build | ||||||
|       - deps |       - deps | ||||||
|       - ~/.cache/dialyzer/plts/ |       - ~/.cache/dialyzer/plts/ | ||||||
|  |  | ||||||
| steps: |  | ||||||
| - name: test | - name: test | ||||||
|   image: bitwalker/alpine-elixir-phoenix:1.13 |   image: bitwalker/alpine-elixir-phoenix:1.13 | ||||||
|   environment: |   environment: | ||||||
| @@ -32,9 +38,20 @@ steps: | |||||||
|       from_secret: docker_password |       from_secret: docker_password | ||||||
|   when: |   when: | ||||||
|     branch: |     branch: | ||||||
|     include: |  | ||||||
|     - stable |     - stable | ||||||
|  |  | ||||||
|  | - name: rebuild-cache | ||||||
|  |   image: drillster/drone-volume-cache | ||||||
|  |   volumes: | ||||||
|  |   - name: cache | ||||||
|  |     path: /cache | ||||||
|  |   settings: | ||||||
|  |     rebuild: true | ||||||
|  |     mount: | ||||||
|  |       - _build | ||||||
|  |       - deps | ||||||
|  |       - ~/.cache/dialyzer/plts/ | ||||||
|  |  | ||||||
| services: | services: | ||||||
| - name: database | - name: database | ||||||
|   image: postgres:13 |   image: postgres:13 | ||||||
| @@ -44,6 +61,9 @@ services: | |||||||
|     POSTGRES_DB: postgres |     POSTGRES_DB: postgres | ||||||
|  |  | ||||||
| volumes: | volumes: | ||||||
|  |   - name: cache | ||||||
|  |     host: | ||||||
|  |       path: /tmp/drone-cache | ||||||
|   - name: docker_sock |   - name: docker_sock | ||||||
|     host: |     host: | ||||||
|       path: /var/run/docker.sock |       path: /var/run/docker.sock | ||||||
|   | |||||||
| @@ -47,6 +47,7 @@ USER nobody:nobody | |||||||
|  |  | ||||||
| COPY --from=build --chown=nobody:nobody /app/_build/prod/rel/cannery ./ | COPY --from=build --chown=nobody:nobody /app/_build/prod/rel/cannery ./ | ||||||
| COPY --from=build --chown=nobody:nobody /app/priv /app/priv | COPY --from=build --chown=nobody:nobody /app/priv /app/priv | ||||||
|  | RUN chmod +x /app/priv/random.sh | ||||||
|  |  | ||||||
| ENV HOME=/app | ENV HOME=/app | ||||||
|  |  | ||||||
|   | |||||||
| @@ -21,7 +21,7 @@ The self-hosted firearm tracker website. | |||||||
| 1. Copy the example [docker-compose.yml](https://gitea.bubbletea.dev/shibao/cannery/src/branch/stable/docker-compose.yml). into your local machine where you want. | 1. Copy the example [docker-compose.yml](https://gitea.bubbletea.dev/shibao/cannery/src/branch/stable/docker-compose.yml). into your local machine where you want. | ||||||
|    Bind mounts are created in the same directory by default. |    Bind mounts are created in the same directory by default. | ||||||
| 1. Set the configuration variables in `docker-compose.yml`. You'll need to run | 1. Set the configuration variables in `docker-compose.yml`. You'll need to run | ||||||
|    `docker run -it shibaobun/cannery mix phx.gen.secret` to generate a new |    `docker run -it shibaobun/cannery /app/priv/random.sh` to generate a new | ||||||
|    secret key base. |    secret key base. | ||||||
| 1. Use `docker-compose up` or `docker-compose up -d` to start the container! | 1. Use `docker-compose up` or `docker-compose up -d` to start the container! | ||||||
|  |  | ||||||
|   | |||||||
| @@ -8,7 +8,7 @@ services: | |||||||
|     environment: |     environment: | ||||||
|       - HOST="your.domain.com" |       - HOST="your.domain.com" | ||||||
|       - DATABASE_URL="ecto://postgres:postgres@cannery-db/cannery" |       - DATABASE_URL="ecto://postgres:postgres@cannery-db/cannery" | ||||||
|       # Use `docker run -it shibaobun/cannery mix phx.gen.secret` to generate a secret key base |       # Use `docker run -it shibaobun/cannery /app/priv/random.sh` to generate a secret key base | ||||||
|       - SECRET_KEY_BASE="change-me-this-is-really-important-seriously-change-it" |       - SECRET_KEY_BASE="change-me-this-is-really-important-seriously-change-it" | ||||||
|       # uncomment to enable public sign ups, not recommended |       # uncomment to enable public sign ups, not recommended | ||||||
|       # - REGISTRATION="public" |       # - REGISTRATION="public" | ||||||
|   | |||||||
							
								
								
									
										4
									
								
								priv/random.sh
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										4
									
								
								priv/random.sh
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,4 @@ | |||||||
|  | #!/usr/bin/env sh | ||||||
|  | set -ou pipefail | ||||||
|  |  | ||||||
|  | cat /dev/urandom | base64 | head -c 64 | ||||||
		Reference in New Issue
	
	Block a user