Skip to content

Commit

Permalink
Fix picfit configuration (#19)
Browse files Browse the repository at this point in the history
  • Loading branch information
fitztrev authored Nov 7, 2023
1 parent b340bed commit 7f853a2
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 7 deletions.
4 changes: 2 additions & 2 deletions command/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,8 @@ fn prompt_for_optional_services() -> Result<Vec<OptionalService>, Error> {
compose_profile: Some(ComposeProfile::Thumbnails),
repositories: None,
},
"Thumbnail generator",
"for resizing blog/streamer images",
"Image uploads + thumbnails",
"for blog/coach/streamer images",
)
.item(
OptionalService {
Expand Down
2 changes: 1 addition & 1 deletion conf/lila.original.conf
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ game.gifUrl = "http://lila_gif:6175"
search.enabled = true
search.endpoint = "http://lila_search:9673"

memo.picfit.endpointGet = "http://picfit:3001"
memo.picfit.endpointGet = "http://localhost:3001"
memo.picfit.endpointPost = "http://picfit:3001"

mailer.primary.mock = false
Expand Down
1 change: 1 addition & 0 deletions conf/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ server {
listen [::]:80;
server_name lichess;

client_max_body_size 4M;
root /lila/public;

location /assets/lifat {
Expand Down
13 changes: 13 additions & 0 deletions conf/picfit.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"debug": true,
"port": 3001,
"options": {
"enable_upload": true
},
"storage": {
"src": {
"type": "fs",
"location": "/uploads/"
}
}
}
2 changes: 2 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,8 @@ services:
- 3001:3001
networks:
- lila-network
volumes:
- ./conf/picfit.json:/mnt/config.json
profiles:
- thumbnails

Expand Down
6 changes: 2 additions & 4 deletions docker/picfit.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.21.3-alpine3.18
FROM golang:1.21.4-alpine3.18

RUN apk add git make

Expand All @@ -7,6 +7,4 @@ WORKDIR /opt
RUN git clone --depth 1 https://github.com/thoas/picfit.git
RUN make -C /opt/picfit build

RUN echo '{"port": 3001}' > /opt/config.json

ENTRYPOINT /opt/picfit/bin/picfit -c /opt/config.json
ENTRYPOINT /opt/picfit/bin/picfit -c /mnt/config.json
1 change: 1 addition & 0 deletions lila-docker
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ run_setup_config() {
if [ ! -z "$GITPOD_WORKSPACE_ID" ]; then
echo "Replacing localhost URLs with Gitpod URLs..."
find ./conf/lila.conf ./conf/lila-ws.conf -type f -exec sed -i "s/http:\/\/localhost:8080/$(gp url 8080 | sed 's/\//\\\//g')/g" {} \;
find ./conf/lila.conf ./conf/lila-ws.conf -type f -exec sed -i "s/http:\/\/localhost:3001/$(gp url 3001 | sed 's/\//\\\//g')/g" {} \;
find ./conf/lila.conf ./conf/lila-ws.conf -type f -exec sed -i "s/localhost:8080/$(gp url 8080 | cut -c9-)/g" {} \;
fi
}
Expand Down

0 comments on commit 7f853a2

Please sign in to comment.