We have one Dockerfile which consists of three stages:
- A Elixir app which compiles, fetches dependencies, ...
- A node.js app which compiles the assets. It uses libraries from the Elixir app.
- A production stage which copies the results from (1) and (2) and runs them.
In development we split the Dockerfile up into two separate containers (using
target directive) to continously re-compile the app and its assets.
Both containers share a volume with docker-sync to perfomantly access changed files as well as for the Elixir app to deliver the compiled assets.
Developers can mount more Containers into the stack with a custom
It can look like this:
version: "3.4" services: adminer: image: adminer ports: - 8080:8080 environment: ADMINER_DEFAULT_SERVER: db ADMINER_DESIGN: pepa-linha
bin/dev, it will run the three containers specified below. You can access the website by visiting
bin/seedto seed the database.
After the initial start things might be wonky. Just restart the app and you should be fine. There are two cases where you need to interact with Docker directly:
- In some cases the containers won't stop after ctrl + c and keep running in the background (
docker ps). If so you need to run
docker-compose downmanually. The same goes for the tests.
If you like you can run
bin/test --watch, which will start a separate stack which continuously runs tests agains a test database.
Hosting and Deployment
- Production URL: klausurarchiv.fachschaft-wiwi.ms
- GitHub builds containers for each commit. Master commits will be pushed to Docker Packages.
- Server listens with watchtower for changes and restarts app container.
Learn more about Phoenix
- Official website: http://www.phoenixframework.org/
- Guides: https://hexdocs.pm/phoenix/overview.html
- Docs: https://hexdocs.pm/phoenix
- Mailing list: http://groups.google.com/group/phoenix-talk
- Source: https://github.com/phoenixframework/phoenix
Copyright (C) 2019 Fachschaft WiWi Uni Münster
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.