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

Dockerize development environment #142

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
FROM node:14-alpine
FROM python:3.10-alpine

RUN mkdir /project

RUN apk add --update npm

RUN pip install poetry

COPY docker_entrypoint.sh /entrypoint.sh

RUN chmod +x /entrypoint.sh

CMD /entrypoint.sh
17 changes: 14 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,26 @@ You will need to specify the ``FONTAWESOME_NPM_AUTH_TOKEN`` environment variable
before installing Node dependenvies. You should be using ``direnv`` locally for
secret management and encryption. Ask for this token, it's private.

You need to be using Node<=14 and at least Python 3.6+, but Python 3.10 is
preferred. Using ``asdf`` is recommended here. With both configured, you can
install all the dependencies with:
You need to be using Node<=14 and Python 3.10.
Using ``asdf`` is a great option for adding Python 3.10 to a system that doesn't have it.
h both configured, you can install all the dependencies with:

.. code-block:: console

$ poetry install
$ npm install

Running in Docker
~~~~~~~~~~~~~~~~~

If you have Docker with docker-compose available, you can run a local development server like this:

.. code-block:: console

$ # invoke direnv to add secret environment
$ docker-compose build # builds the server
$ docker-compose up
benjaoming marked this conversation as resolved.
Show resolved Hide resolved

Local development and authoring
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Expand Down
18 changes: 18 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
version: '3'

volumes:
build:

services:

server:
# Image used for all the other services (proxito, web, celery, build)
build:
context: ${PWD}
dockerfile: ./Dockerfile
environment:
- FONTAWESOME_NPM_AUTH_TOKEN=${FONTAWESOME_NPM_AUTH_TOKEN}
ports:
- "8000:8000"
volumes:
- ${PWD}/:/project
benjaoming marked this conversation as resolved.
Show resolved Hide resolved
3 changes: 3 additions & 0 deletions docker_entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
cd /project
poetry install
npm install