jsonresume / registry-server

This repo is deprecated in favor of https://github.com/jsonresume/registry-functions
https://github.com/jsonresume/registry-functions
MIT License
95 stars 46 forks source link

Dockerize dev environment #44

Open ThomWright opened 9 years ago

ThomWright commented 9 years ago

@williammartin

williammartin commented 9 years ago

Heads up, this will be a bit of a brain dump....

So what would we actually like here from a user perspective? To be able to run:

docker-compose up

and have two containers spun up, one for the registry server, one for mongodb and have them linked together?

Would we want this to be a kind of testbed where the data is ephemeral and disappears after the containers go away or keep it around even if we remove the containers? What does the Vagrant solution do?

Finally, some people prefer their docker separated from their code. We could have another repository under the jsonresume org or we can put the necessary files in this repo - any preferences?

ThomWright commented 9 years ago

Please note: I'm coming from a position of ignorance as far as Docker goes :stuck_out_tongue:

Running docker-compose up and spinning up/linking the containers sounds good to me.

Personally I think I'm OK with it being an ephemeral test-bed if that's easier, but having it persistent would be cool.

Vagrant saves the state of your VM. Unless you destroy and re-create the VM, the data in Mongo is kept (even if you re-provision, I think).

What are the arguments for/against separating/integrating the docker stuff?

williammartin commented 9 years ago

I would be very surprised if it is difficult to make the data persistent - mostly depends on how mongo stores its data.

Arguments around separating are basically the usual coupling ones, that you end up having both build and deployment artifacts in the same repo. No big deal either way I think. Probably best to keep things together for now and split out later if necessary?

PeterDaveHello commented 7 years ago

Hey guys I added Dockerfile in https://github.com/jsonresume/registry-server/commit/2ec97fcdd9213f5e1a87ed554bc01ba9f2c7f9e5 and published on Docker Hub here, feel free to try and give feedback, thanks a lot!

milovanderlinden commented 4 years ago

I managed to simplify the Dockerfile by using node:14 as base image.

From node:14

MAINTAINER Peter Dave Hello <hsu@peterdavehello.org>
ENV DEBIAN_FRONTEND noninteractive

COPY . /registry-server
WORKDIR /registry-server

RUN git submodule update --init --recursive --depth 1
RUN npm install --prefix "/registry-server"

EXPOSE 3000 5000

ENTRYPOINT ["npm", "start"]

This works, but I then also discoverd that the connection to the theme server is hardcoded but because the theme server doesn't have CORS enabled, this will fail. I solved it by copying /lib/theme.js from the themeserver repository and adding the corresponding routes to server.js/ This also resulted in errors because the themes are grabbed from the / route by the editor. By updating the routes to use /theme, I now have a working combined registry-server and theme-server. For details, check this commit: https://github.com/codefornl/registry-server/commit/b20864f896b909ed2a6e5f62b30f4618a0f47e11