Skip to content
This repository was archived by the owner on Jun 27, 2019. It is now read-only.

Fix docker setup - #148

Merged
appinteractive merged 12 commits into
developfrom
fix-docker-setup
Aug 24, 2018
Merged

appinteractive merged 12 commits into
developfrom
fix-docker-setup

Conversation

@roschaefer

@roschaefer roschaefer commented Aug 12, 2018 •

Copy link
Copy Markdown
Contributor

This PR has commits of #147 and should be rebased after #147 is merged.

  • expose minimal number of ports in Dockerfile

@roschaefer

Copy link
Copy Markdown
Contributor Author

I would like to test thumbor in the docker environment. The service is up and running but unfortunately I cannot see anything. Do thumbnails get created in development?

@appinteractive

appinteractive commented Aug 12, 2018 •

Copy link
Copy Markdown
Member

If you want to use thumbor in docker you have to add the key and url to the config. Currently the url is empty that’s why it fails.

@roschaefer

Copy link
Copy Markdown
Contributor Author

@appinteractive that's the README, I've set the url. Should a database seeding in development environment create thumbnails after all?

@appinteractive

Copy link
Copy Markdown
Member

@roschaefer yes the seeding in development gets random image urls which are downloaded by the remote-images hook and then returned as (secure) thumbor urls (if configured, otherwise local paths) which then gets served by thumbor (if its running)

Comment thread Dockerfile
ENV NODE_ENV=production
ENV API_PORT=3030
# create working directory
RUN mkdir -p /API

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ich würde das COPY . /API direkt nach dem erstellen des API Verzeichnises machen, dann muss man später die package.json und yarn.lock auch nicht reinkopieren.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The COPY at the end is to speed up rebuilds. Docker caches every step. If you change your files, COPY . /API is the first step to be re-run. Putting that at the end will cache all steps prior to that.

Comment thread Dockerfile
COPY package.json /API
COPY yarn.lock /API
RUN yarn install --frozen-lockfile --non-interactive

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nachdem die Abhängigkeiten installiert wurden musste ich noch RUN yarn global add cross-env nodemon ausführen, weil das starten der API und mongod sonst nicht ging. Gerade startet bei mir nur die API nicht. Es kann server-favicon nicht geladen werden..

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that's weird, I'm going to check that

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed all my images, volumes and containers from the cache and rebuild everything and I cannot reproduce that error. Super weird.

@roschaefer

Copy link
Copy Markdown
Contributor Author

@appinteractive Why is codacy complaining about a missing maintaner? The MAINTAINER directive is deprecated.

@appinteractive

Copy link
Copy Markdown
Member

@roschaefer we don’t have to bother about that codacy issue for now.

.. and overwrite in docker-compose. Move layer COPY as far as possible
to the end for faster rebuild.
Reason: I might want to set database cleaner configs withouth rebuilding
the docker container. So, syncing the config/ folder would be desired.
But then we don't want the configuration for the host system to get in
conflict with the docker settings. Solution: Set node instance
environment variable to `docker`.
Problem: Although thumbor is reachable from within the container, I
cannot see any thumbnails in development environment. Maybe the seeder
does not create thumbnails?
@roschaefer
roschaefer force-pushed the fix-docker-setup branch 3 times, most recently from 350cfc4 to 7cabe76 Compare August 24, 2018 19:53
@roschaefer roschaefer changed the title [WIP] Fix docker setup Fix docker setup Aug 24, 2018
@appinteractive
appinteractive merged commit e7c2d4d into develop Aug 24, 2018
@appinteractive
appinteractive deleted the fix-docker-setup branch August 24, 2018 21:50
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants