Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker support #2080

Closed
nicobo opened this issue Mar 13, 2020 · 17 comments
Closed

Docker support #2080

nicobo opened this issue Mar 13, 2020 · 17 comments
Labels
⚙️ Deployment Related to specific deployments or configurations

Comments

@nicobo
Copy link

nicobo commented Mar 13, 2020

Hi guys

Are there any plan to provide a docker image for pixelfed ?

I can see several images on hub.docker.com already : did you test any of those ?

@mplx
Copy link

mplx commented Mar 24, 2020

I did a docker container some weeks ago, maybe you want to testdrive it?

https://hub.docker.com/r/mplx/docker-pixelfed
https://github.com/mplx/docker-pixelfed

Personally I'm using it just standalone without fediverse enabled yet and it seems quite stable (I'm having minor issues* but currently I don't have time to work on it, so any feedback is appreciated. I was hoping dansup to do a fresh stable/tagged release to see if issues are solved).

(* i.e. no infinite scroll in user page, "loading..." text below username in main screen)

@nicobo
Copy link
Author

nicobo commented Mar 26, 2020

Right I'll do that. I don't have much free time nowadays though, it may take some time for me to give feedback.

@nicobo
Copy link
Author

nicobo commented Mar 26, 2020

@mplx Discussion follows there : mplx/docker-pixelfed#1

@almereyda
Copy link

There have been some updates on the docker-compose.yml and Dockerfiles in the last month.

Before being able to use the configuration, I had to uncomment the /var/www/bootstrap (to make app.php available) and to run

docker-compose build app
docker-compose run --rm app cp -R storage.skel/* storage/
docker-compose run --rm app php artisan key:generate
docker-compose run --rm app php artisan migrate

and then went on with https://docs.pixelfed.org/running-pixelfed/administration.html

docker-compose up -d
docker-compose exec app php artisan create:user

Mapping ./bootstrap/cache:/var/www/bootstrap/cache instead in app and worker allowed to resolve the issue with bootstrap/app.php not being found.

@trwnh trwnh added the ⚙️ Deployment Related to specific deployments or configurations label Jul 11, 2020
@trwnh trwnh added this to the 1.0.0 - Stable Release milestone Jul 11, 2020
@albjeremias
Copy link
Contributor

are there any news on that? what means the .env.production file? are upgrades available? where is the documentation? Need help?

@SurvivaLlama
Copy link

+1 - For this to really take off, a docker would really help.

@binerf
Copy link

binerf commented Dec 28, 2020

Hi,
On my side, I managed to make it works with docker and files provided from master branch.

I can create user, post photos and follow users from other instances (user on another instance can also follow user on my instance) but there is not communication between my instance and others. My user can send DM to another user but not the other side.

After "docker-compose up", I have to login the app docker instance and execute commands:

# docker exec -ti pixelfed_app_1 bash
root@eebee7f352a5:/var/www# rm /var/www/html/storage
root@eebee7f352a5:/var/www# php artisan storage:link
root@eebee7f352a5:/var/www# php artisan migrate --force
root@eebee7f352a5:/var/www# php artisan import:cities
root@eebee7f352a5:/var/www# php artisan route:cache
root@eebee7f352a5:/var/www# php artisan view:cache
root@eebee7f352a5:/var/www# php artisan config:cache
root@ba3a4afb68b2:/var/www# php artisan passport:keys

then execute command:
php artisan horizon
But still, federation doesn't look working....

Any suggestion ?

@s00500
Copy link

s00500 commented Mar 6, 2021

Hey everyone, I used your post and also could make it run in docker by manually runing migrations
I also ran
php artisan instance:actor

But I could not get my instance to federate yet....

@fengwang
Copy link

fengwang commented May 5, 2021

@mplx Could you please update the instructions more detailedly? The docker file is not self-explaining, and a list of example configurations and commands is appreciated.

@ledyba
Copy link

ledyba commented Jun 21, 2021

Hi, I'm running my instance, https://fotoj.hexe.net/ using docker and docker-compose.
Here are docker files and docker-compose.yml. Please re-use it freely (You will need some modification!).

https://github.com/fairy-rockets/fotoj-compose

@woj-tek
Copy link

woj-tek commented Aug 31, 2022

OK, I was pondering having "place to publish fotos akin to instagram" so I found pixelfed and it looked just perfect. I thought it would be a breaze to add it to a couple of services I already run in docker on my RPi but... unfortunatelly it's not so straightforward. Has there been a consideration to provide official docker image with sane defaults and minimal configuration requirement (basically setting up domain name)?

There is another ticket (#3337) but it seems like a duplicate of this...

@Kovah
Copy link
Contributor

Kovah commented Oct 30, 2022

Hi everyone. I have set up a Docker image build process via my fork for both x86 and ARM. I will receive notifications for new Pixelfed releases and will then trigger an update of the Docker image. Hope that helps some people. I tested this with a production deployment and had no issues. Queue workers are running fine too.
Please note that GD is disabled to reduce the final image size.

The image is available to the public on Docker Hub: kovah/pixelfed-docker

@woj-tek
Copy link

woj-tek commented Oct 31, 2022

@Kovah Could you provide example docker-compose.yaml that you've used? :-)

@Kovah
Copy link
Contributor

Kovah commented Oct 31, 2022

It is basically the one from the repo with changes according to my personal needs. So, I guess this should work:

---
version: '3'
services:
## App and Worker
  app:
    image: kovah/pixelfed-docker:latest
    restart: unless-stopped
    env_file:
      - .env.docker
    volumes:
      - app-storage:/var/www/storage
      - app-bootstrap:/var/www/bootstrap
      - "./.env.docker:/var/www/.env"
    networks:
      - external
      - internal
    ports:
      - "8080:80"
    depends_on:
      - db
      - redis

  worker:
    image: kovah/pixelfed-docker:latest
    restart: unless-stopped
    env_file:
      - .env.docker
    volumes:
      - app-storage:/var/www/storage
      - app-bootstrap:/var/www/bootstrap
    networks:
      - external
      - internal
    command: gosu www-data php artisan horizon
    depends_on:
      - db
      - redis

## DB and Cache
  db:
    image: mysql:8.0
    restart: unless-stopped
    networks:
      - internal
    command: --default-authentication-plugin=mysql_native_password
    env_file:
      - .env.docker
    volumes:
      - "db-data:/var/lib/mysql"

  redis:
    image: redis:6-alpine
    restart: unless-stopped
    env_file:
      - .env.docker
    volumes:
      - "redis-data:/data"
    networks:
      - internal

volumes:
  db-data:
  redis-data:
  app-storage:
  app-bootstrap:

networks:
  internal:
    internal: true
  external:
    driver: bridge
```

@der-On
Copy link
Contributor

der-On commented Nov 10, 2022

I've created a PR that updates the contrib/docker/Dockerfile.apache to PHP 8.1 and compose 2.4.4 #3740

@Murazaki
Copy link
Contributor

Murazaki commented Dec 24, 2022

Please look at #4050, I made a pull request with a docker build workflow based on what was already done by @Kovah and mastodon.
You can also get the build from https://hub.docker.com/r/murazaki/pixelfed

@dansup
Copy link
Member

dansup commented Jan 3, 2024

Superseded by #4844

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
⚙️ Deployment Related to specific deployments or configurations
Projects
None yet
Development

No branches or pull requests