Core: How to run migrations using Docker?

Created on 8 Aug 2016  路  6Comments  路  Source: adonisjs/core

Found an error when docker runs ./ace migration:run.

Step 10 : RUN ./ace migration:run --force
 ---> Running in 1955bc7328f4
/usr/bin/env: node --harmony_proxies: No such file or directory
The command '/bin/sh -c ./ace migration:run --force' returned a non-zero code: 127

Do you have a solution for this? Thanks!

All 6 comments

This is a issue with Ubuntu/Linux distributions that they don't recognize node on /usr/bin/env: node location.

You can run ace commands are node --harmony_proxies ace <command>

Thanks, it worked! I have another problem using docker. The app isn't loading when I run docker. I set the port in my .env to 3000.

This is my Dockerfile:

# Define the image
FROM node:6.3

ENV NODE_ENV development
ENV APP_PATH /usr/src/app

# Replace this with the RDS url.
ENV DB_URL postgres://postgres:password@localhost:5432/load

# Create the app directory
RUN mkdir -p $APP_PATH

# Bundle app source
COPY . $APP_PATH
COPY .env $APP_PATH
WORKDIR $APP_PATH

# Install
RUN npm install

# MIGRATE
RUN node --harmony_proxies ace migration:run --force

# Run it in port 3000
EXPOSE 3000

# Start it
CMD [ "npm", "start" ]

I run docker using the command docker run -p 3000:3000 -d load .

Docker logs says that the app is running but when I access localhost:3000, all i see is a page saying The localhost page isnt't working, localhost didn't send any data., ERR_EMPTY_RESPONSE.

Docker logs:

jeetkunedo 禄 docker logs 95451148183c
npm info it worked if it ends with ok
npm info using [email protected]
npm info using [email protected]
npm info lifecycle [email protected]~prestart: [email protected]
npm info lifecycle [email protected]~start: [email protected]

> [email protected] start /usr/src/app
> node --harmony_proxies server.js

info adonis:framework [Mon Aug 08 2016 10:41:45 GMT+0000 (UTC)] serving app on localhost:3000

Thanks for answering!

Seems to be issue with docker not binding to the localhost properly. I am not a docker guy, so can't comment much on the same. But you can try running a basic Html page on localhost:3000 to see if that works.

Thanks for helping!

It was just a misconfiguration of the server to listen to localhost only. I used 0.0.0.0 instead of localhost in .env for the host.

Thanks for helping!

It was just a misconfiguration of the server to listen to localhost only. I used 0.0.0.0 instead of localhost in .env for the host.

Thanks, i was having the same issue.

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

douglaszaltron picture douglaszaltron  路  3Comments

codingphasedotcom picture codingphasedotcom  路  3Comments

themodernpk picture themodernpk  路  3Comments

PC-HUB picture PC-HUB  路  4Comments

umaams picture umaams  路  3Comments